• Resolved sergey2020

    (@sergey2020)


    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?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I delete a Yoast SEO plugin comment?’ is closed to new replies.