Support » Plugin: Yoast SEO » How to noindex tag page where only 1 post

  • Resolved serezh4

    (@serezh4)


    Hi! My tag pages (site.com/tag/…/) are indexed. But some tag pages have only 1 post. How I can index all tag pages but noindex if tag page contains only 1 post?

    • This topic was modified 2 years, 4 months ago by serezh4.
    • This topic was modified 2 years, 4 months ago by serezh4.
Viewing 5 replies - 1 through 5 (of 5 total)
  • You should be able to go to Posts -> Tags and then click on the tag and update the Yoast settings to add a no-index tag. This is a manual process.

    If you want to do it dynamically, then you’d have to write some code to figure out how many posts are in the tag and then inset the noindex tag via the wpseo_head filter if it’s 1.

    Thread Starter serezh4

    (@serezh4)

    Can you please tell me what code I need to do it dynamically?

    If I can find time maybe.

    Plugin Support Pcosta88

    (@pcosta88)

    Hi @serezh4

    While Yoast does not have the ability to dynamically you can do this with code. It would need to be developed. We have some filters here which you will need to build off of: https://gist.github.com/amboutwe/0c71e42aa164238007d7ea88f174a93f/#file-yoast_seo_robots_remove_single-php.

    Unfortunately, there’s a difference between the support we can offer and the level of programming needed to change (core) features of our plugin. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes. And even though we cannot be of any assistance, you’re completely free to change anything in the plugin to better suit your needs.

    If needed, we highly recommend checking out the Yoast supported partners here: https://yoast.com/yoast-partners/. 

    We will keep this open for 7 days in case someone from the community can offer a solution. After that we will close this to keep the overview.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to noindex tag page where only 1 post’ is closed to new replies.