Replies: 0
To remove the Yoast SEO comment I use in functions.php:
add_action ('get_header', 'rmyoast_ob_start');
add_action ('wp_head', 'rmyoast_ob_end_flush', 100);
function rmyoast_ob_start () {
ob_start ('remove_yoast');
}
function rmyoast_ob_end_flush () {
ob_end_flush ();
}
function remove_yoast ($ output) {
if (defined ('WPSEO_VERSION')) {
$ output = str_ireplace ('<! - This site is optimized with the Yoast SEO plugin v'. WPSEO_VERSION. '- https://yoast.com/wordpress/plugins/seo/ ->', '', $ output );
$ output = str_ireplace ('<! - / Yoast SEO plugin. ->', '', $ output); }
return $ output;
}
Is there an easier solution?