Created
April 17, 2019 19:16
-
-
Save robwent/f36e97fdd648a40775379a86bd97b332 to your computer and use it in GitHub Desktop.
Remove Yoast HTML Comments “This site is optimized with the Yoast WordPress SEO plugin” with Yoast v11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Remove Yoast HTML Comments | |
//https://gist.github.com/robwent/f36e97fdd648a40775379a86bd97b332 | |
function go_yoast() { | |
if (defined('WPSEO_VERSION')){ | |
add_action('get_header',function (){ ob_start(function ($o){ | |
return preg_replace('/\n?<.*?Yoast SEO plugin.*?>/mi','',$o); }); }); | |
add_action('wp_head',function (){ ob_end_flush(); }, 999); | |
} | |
} | |
add_action('plugins_loaded', 'go_yoast'); |
@justinrains Try this instead: https://gist.github.com/paulcollett/4c81c4f6eb85334ba076
It's updated more often.
Looks like they have added a filter now so you only need a single line that shouldn't break in the future:
add_filter( 'wpseo_debug_markers', '__return_false' );
Thanks! I'm going to try it now.
…On Mon, Oct 19, 2020 at 6:13 AM Robert Went ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
@justinrains <https://github.com/justinrains> Try this instead:
https://gist.github.com/paulcollett/4c81c4f6eb85334ba076
It's updated more often.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://gist.github.com/f36e97fdd648a40775379a86bd97b332#gistcomment-3494568>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEUWEEOQYJF4JQP5IET3J3SLQGKJANCNFSM4SUTCPVA>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No cache installed. It's still in the source of the page.