Quantcast
Channel: Active questions tagged yoast - Stack Overflow
Viewing all articles
Browse latest Browse all 97

Wordpress > Yoast > How to adjust (or disable) Meta-Robots for Comment-URLs?

$
0
0

It would be wonderful if someone could enlighten me about the use of meta-robots for comment-urls in Yoast.

As you can see in the source code of these example URL:

https://www.bussgeldkatalog.org/geschwindigkeitsueberschreitung/comment-page-2/https://www.bussgeldkatalog.org/geschwindigkeitsueberschreitung/comment-page-3/

two contradicting meta-robots commands are played out. The first one says “noindex”, whereas the second one from Yoast says “index”. There should be one unique meta-robots tag for these comment URLs saying “noindex, follow”.

How can I possibly make Yoast either turn its “index, follow” meta-robots tag into a “noindex, follow” one or, even better, completely disable Yoast meta-robots only on comment URLs?

Surfing on the web I found a code-snippet that could help me with the latter:

add_filter( ‘wpseo_robots’, ‘yoast_seo_robots_remove_single’ );function yoast_seo_robots_remove_single( $robots ) {if ( is_single ( 123456 ) ) {return false;} else {return $robots;}}

The problem is that I have no idea how to change “is_single ( 123456 )” into a different identifier, which includes all the comment URLs, and nothing else.

Looking forward for any valuable hints!

Stay positive & test negative,Roman


Viewing all articles
Browse latest Browse all 97

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>