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.
Can you please tell me what code I need to do it dynamically?
If I can find time maybe.
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.
We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.