easiest; add <!-- noptimize-page --> (exactly like that) to the post HTML view.
alternatively I can provide a code snippet to exclude with a couple of lines of code, just say the word 🙂
Im glad Thanks.. I need code snippet you mention above.
OK, here’s your personalized example 🙂
add_filter('autoptimize_filter_noptimize','vanderklompen_ao_noptimize',10,1);
function vanderklompen_ao_noptimize( $flag_in ) {
if ( strpos( $_SERVER['REQUEST_URI'], '2021/02/16/title-post.html' ) !== false ) {
return true;
} else {
return $flag_in;
}
}
hi. is that code exclude all my single post from autoptimize? as you know all my post has “.html” at the end of the slug.
ah, no, that snippet excluded specifically 2021/02/16/title-post.html 🙂
the following excludes all posts;
add_filter('autoptimize_filter_noptimize','vanderklompen_ao_noptimize',10,1);
function vanderklompen_ao_noptimize( $flag_in ) {
if ( is_single() ) {
return true;
} else {
return $flag_in;
}
}
it seem working…. but maybe i have a little problem with the cache. anyway thanks for your time