Support » Plugin: Autoptimize » How to exclude certain pages from being ‘autooptimised’?

Viewing 1 replies (of 1 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    it is, with a couple of lines of code hooking into AO’s api, for example to stop AO on the /contact/map page you would use this;

    add_filter('autoptimize_filter_noptimize','carolineelisa_noptimize',10,0);
    function carolineelisa_noptimize() {
    	if ( strpos($_SERVER['REQUEST_URI'], '/contact/map' ) !== false ) {
    		return true;
    	} else {
    		return false;
    	}
    }

    hope this helps,
    frank

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.