• Resolved ovlasqz

    (@ovlasqz)


    Hi!
    I want to know how can I include the homepage of my website into an exclude list in Autoptimize?

    The page I need help with: [log in to see the link]

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

    (@optimizingmatters)

    to have the homepage NOT optimized you mean? you can use this code snippet;

    
    add_filter('autoptimize_filter_noptimize','home_noptimize',10,0);
    function home_noptimize() {
    	if ( is_front_page() ) {
    		return true;
    	} else {
    		return false;
    	}
    }

    hope this helps,
    frank

    I’m currently able to disable on a single page, but I’d like to disable on several specific ones. What would be the correct function snippet for excluding more than one page? How would the code look different than below?

    add_filter('autoptimize_filter_noptimize','my_ao_noptimize',10,0);
    function my_ao_noptimize() {
    	if (strpos($_SERVER['REQUEST_URI'],'bgb-tv')!==false) {
    		return true;
    	} else {
    		return false;
    	}
    }
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    suppose you want to exclude bgb-tv, bgb-radio and bgb-talking-drums, the 3rd line would become;

    if ( strpos($_SERVER['REQUEST_URI'],'bgb-tv')!==false || strpos($_SERVER['REQUEST_URI'],'bgb-radio')!==false || strpos($_SERVER['REQUEST_URI'],'bgb-talking-drums')!==false ) {

    hope this helps,
    frank

    Wonderful, thanks!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome @bgbandya, feel free to leave a review of the plugin and support here! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Exclude List’ is closed to new replies.