• Resolved van24

    (@van24)


    Hi Frank, awesome plugin!

    I have a form on one page of a website. It’s getting broken by Autoptimize, but if I switch off JS minification then it works OK. However, I don’t want to switch JS minification off for the entire site.

    Can I disable AO for a single page? Or, can I disable JS minification only on that page?

    Many thanks in advance ??

Viewing 1 replies (of 1 total)
  • Plugin Author Frank Goossens

    (@futtta)

    you can;

    add_filter('autoptimize_filter_noptimize','van24_noptimize',10,0);
    function van24_noptimize() {
    	if (strpos($_SERVER['REQUEST_URI'],'your-single-page')!==false) {
    		return true;
    	} else {
    		return false;
    	}
    }

    where ‘your-single-page’ should hold a unique string from your path (suppose you have https://your.domain.here/blog/form-page you could use ‘blog/form-page’)

    frank

Viewing 1 replies (of 1 total)
  • The topic ‘Disable for a single page’ is closed to new replies.