// For Yoast SEO Plugin Version: 14.1+ add to your Wordpress Theme's functions.php... | |
// Remove All Yoast HTML Comments | |
// https://gist.github.com/paulcollett/4c81c4f6eb85334ba076 | |
// Credit @devendrabhandari (https://gist.github.com/paulcollett/4c81c4f6eb85334ba076#gistcomment-3303423) | |
add_filter( 'wpseo_debug_markers', '__return_false' ); | |
// For Yoast SEO Plugin Version: < 14.1 add to your Wordpress Theme's functions.php... | |
// Remove All Yoast HTML Comments | |
// https://gist.github.com/paulcollett/4c81c4f6eb85334ba076 | |
// Credit @maxyudin (https://gist.github.com/paulcollett/4c81c4f6eb85334ba076#gistcomment-2937964) | |
add_action('wp_head',function() { ob_start(function($o) { | |
return preg_replace('/\n?<.*?yoast seo plugin.*?>/mi','',$o); | |
}); },~PHP_INT_MAX); |
This comment has been minimized.
This comment has been minimized.
It was working great. Now with yoast seo premium v3.4.2, this will break the colored bulletin in top of the admin bar, can you update the code? |
This comment has been minimized.
This comment has been minimized.
Thanks. |
This comment has been minimized.
This comment has been minimized.
how not remove title? |
This comment has been minimized.
This comment has been minimized.
@worldsdream Can you link or send me a copy of yoast seo premium v3.4.2? I'll get this updated |
This comment has been minimized.
This comment has been minimized.
Replace the regex with this: |
This comment has been minimized.
This comment has been minimized.
This worked perfect for me ... thanks! |
This comment has been minimized.
This comment has been minimized.
Thanks @eric-mathison, I've updated the gist |
This comment has been minimized.
This comment has been minimized.
Thanks, now all is working with the latest Yoast! |
This comment has been minimized.
This comment has been minimized.
thanks!! in Yoast SEO plugin v5.2 well working |
This comment has been minimized.
This comment has been minimized.
Not working for me: Wordpress 4.8.2 |
This comment has been minimized.
This comment has been minimized.
It working,super! |
This comment has been minimized.
This comment has been minimized.
I've just updated the above gist. Tested with: Wordpress 4.9 (/cc @mike-source) |
This comment has been minimized.
This comment has been minimized.
Yoast 5.7.1 If you activated "forced rewrite titles" don't work... UPDATED! Uncheck "forced rewrite titles" |
This comment has been minimized.
This comment has been minimized.
Yoast SEO plugin v5.8 Not working for me. |
This comment has been minimized.
This comment has been minimized.
It works (WP 4.9 + plugin v5.8) if you get rid of the check on 'WPSEO_VERSION' but I am not sure of any performance or reliability implications.
Edit: I just looked through the code and the check for WPSEO_VERSION should really work, so I am a bit puzzled myself. Anyway, consider this a drive-by comment as I wasn't specifically here for this, but just stumbled upon it. But, this is truly a wake up call for me to scrutinize these WordPress plugins more thoroughly. |
This comment has been minimized.
This comment has been minimized.
Performance wise, it would be exactly same. I'll update the code above |
This comment has been minimized.
This comment has been minimized.
Nice, thx u |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@TomasHurtz, should be valid PHP5+, maybe your code editor is reporting for earlier versions of PHP. Glad to hear it's still working for the community! |
This comment has been minimized.
This comment has been minimized.
Thanks. Works great with Yoast v8.2. |
This comment has been minimized.
This comment has been minimized.
+1 i use yoast 8.3 and wp 4.9 |
This comment has been minimized.
This comment has been minimized.
I tried, and it happened. I cited my source in a paper, thank you. |
This comment has been minimized.
This comment has been minimized.
thanks for the information https://www.paktogel.com/data-keluaran-singapura-live-result-sgp-prize/ |
This comment has been minimized.
This comment has been minimized.
thanks for the information http://datapengeluarantoto.com/nomor-pengeluaran-togel-hongkong-result-hk-live/ |
This comment has been minimized.
This comment has been minimized.
since last update of yoast 11 there is a problem with this cause it is printing code on header |
This comment has been minimized.
This comment has been minimized.
Since plugin version 11 the original code breaks the Knowledge Graph & Schema.org contents (opening
|
This comment has been minimized.
This comment has been minimized.
Hi all, I found this function which seems lighter than a "heavy" replace:
Also please note that as said by @maxyudin , the previous code breaks the script tag, adding the printed code in the body. |
This comment has been minimized.
This comment has been minimized.
Looks good.. thanks dude... I'll try... http://ideunik.com/ |
This comment has been minimized.
This comment has been minimized.
The method seems to be called "debug_mark" in the latest version of Yoast,
|
This comment has been minimized.
This comment has been minimized.
Thanks |
This comment has been minimized.
This comment has been minimized.
Now use the below code to remove Yoast HTML Comments from version 14.1
|
This comment has been minimized.
This comment has been minimized.
Thank you! It works! |
This comment has been minimized.
This comment has been minimized.
Also works for me. Thanks |
This comment has been minimized.
This comment has been minimized.
Hello, |
This comment has been minimized.
This comment has been minimized.
It Works! Thank you! |
This comment has been minimized.
This comment has been minimized.
Awesome! Thanks for the code. Much appreciated! |
This comment has been minimized.
Thanks, works for me /May, 07, 2016/