Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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