S
S
skdon2016-03-02 18:36:34
WordPress
skdon, 2016-03-02 18:36:34

Wordpress Autoptimize, why can't I turn it off?

The site has the well-known Autoptimize plugin installed. On some pages it is necessary that it does not work, i.e. when opened, it did not optimize them. Please tell me if there is a way to turn it off.
Let's say I disable other plugins in function.php like this

function remove_plugin_wpportfolio() {
        remove_action('wp_head', 'WPPortfolio_styles_frontend_renderCSS');
        wp_deregister_script('stw-pagepix');
    }
    function remove_plugin_filegallery() {
        wp_dequeue_style('file_gallery_nikitak');
        wp_dequeue_style('file_gallery_default');
        wp_dequeue_style('file_gallery_columns');
    }

I try this one in the same way, it doesn't work.
remove_action('after_setup_theme','autoptimize_do_cachepurged_action');

Maybe I'm doing something wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vorotnev, 2016-03-04
@skdon

add_filter('autoptimize_filter_noptimize','my_ao_noptimize',10,0);
function my_ao_noptimize() {
  if (strpos($_SERVER['REQUEST_URI'],'слаг-страницы')!==false) {
    return true;
  } else {
    return false;
  }
}

Actually, the code is from the plugin author himself. Taken here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question