0

I'm trying to dequeue some scripts on woocommerce product, but for some reason I can’t find a way to check for a single product.

is_singular('product') doesn't work for some reason. The dequeue itself works without the checks, e.g.:

add_action( 'wp_enqueue_scripts', 'my_custom_scripts', 100 );
function my_custom_scripts()
{
    wp_deregister_script( 'wp-mediaelement' );
    wp_deregister_style( 'wp-mediaelement' );
}
1
  • I believe it's too early to use the conditional functions in that hook
    – Tom J Nowell
    Sep 14, 2020 at 8:25

1 Answer 1

1

https://docs.woocommerce.com/document/conditional-tags/

you can try is_product() its on the woocommerce docs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.