Skip to content

Instantly share code, notes, and snippets.

@Tabrisrp
Created December 22, 2017 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tabrisrp/b2218898267332ffc358c08106558052 to your computer and use it in GitHub Desktop.
Save Tabrisrp/b2218898267332ffc358c08106558052 to your computer and use it in GitHub Desktop.
Exclude specific post type/taxonomy from automatic critical CSS generation
<?php
function wp_rocket_cpcss_exclude_post_type( $excluded_post_types ) {
$excluded_post_types[] = 'page';
return $excluded_post_types;
}
add_filter( 'rocket_cpcss_excluded_post_types', 'wp_rocket_cpcss_exclude_post_type' );
function wp_rocket_cpcss_exclude_taxonomy( $excluded_taxonomies ) {
$excluded_taxonomies[] = 'category';
return $excluded_taxonomies;
}
add_filter( 'rocket_cpcss_excluded_taxonomies', 'wp_rocket_cpcss_exclude_taxonomy' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment