Remove Yoast HTML Comments in Version 11.0

Wordpress Code

If you were previously stripping Yoast HTML comments on your website then there is a good chance that updating to v11.0 will show the new schema data at the top of your website.

The problem is that a widely used snippet for stripping out the comments searched for the string 'yoast' and then removed the surrounding comment tags. The new schema data added in V11.0 uses the word 'yoast' as a class on the script tag, so the script tags get stripped and the schema data shows at the top of the website.

We can fix this by making the search term more specific so that it strips the comments but misses the schema class.