you can exclude pages from being autoptimized based on the path, e.g.
add_filter('autoptimize_filter_noptimize','Mudassar_noptimize',10,0);
function Mudassar_noptimize() {
if (strpos($_SERVER['REQUEST_URI'],'page/wpfrom/')!==false) {
return true;
} else {
return false;
}
}
would stop AO on all URL’s that have page/wpform
in them.
hope this helps,
frank
Hi,
Thank you for the reply. I tried the code in function.php but it didn’t seem to work. Is there any other thing we need to add in this code?
Weird … can you copy/paste the exact code you used and can you tell me where/how you added it?
Hi,
I used it at the end of function.php on morenews.pk and following the screenshot of the code i used.
http://prntscr.com/kbmj7g
ah, but you need to adapt page/wpform
to something that matches the URL on which you have the wpforms Musassar 🙂
oops…yeah, you are right. I was so dumb. It worked. Much thanks. And I also tried to put multiple pages with commas and they also worked. Thanks again.