You can use conditional tags to target the specific page you need to remove the styles on. You can use is_page()
to target a page page (as opposed to another post type) and pass a page ID, slug, title, or no argument to target any page.
function wpse_217881_remove_scripts() {
// Check for the page you want to target
if ( is_page( 'About Me And Joe' ) ) {
// Remove Styles
wp_dequeue_style( 'parent-style' );
wp_dequeue_style( 'child-style' );
wp_dequeue_style( 'parent-style-css' );
wp_deregister_style( 'parent-style' );
wp_deregister_style( 'child-style' );
wp_deregister_style( 'parent-style-css' );
}
}
I’m assuming you already are, but to be explicit, you should be calling the function that dequeue/deregisters the styles from an action hook – in this instance wp_enqueue_scripts
.
From the wp_enqueue_scripts
docs:
Despite the name, it is used for enqueuing both scripts and styles
add_action( 'wp_enqueue_scripts', 'wpse_217881_remove_scripts' );
// Optionaly add a priority if needed i.e:
// add_action( 'wp_enqueue_scripts', 'wpse_217881_remove_scripts', 20 );