Title: Dequeue Stylesheet
Last modified: October 18, 2022

---

# Dequeue Stylesheet

 *  [Sean Thompson](https://wordpress.org/support/users/seanthompson/)
 * (@seanthompson)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/dequeue-stylesheet/)
 * Hi,
 * I’m trying to dequeue the stylesheet everywhere except the page with the shortcode.
 * Can’t seem to get it to work.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [farroyo](https://wordpress.org/support/users/farroyob/)
 * (@farroyob)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/dequeue-stylesheet/#post-16110188)
 * Hi there!
 * I guess you are talking about the following stylesheet:
 * `/wp-content/plugins/wp-store-locator/css/styles.min.css`
 * If you want to dequeue it from all pages except, say, page with id=1, you could
   try this code snippet:
 *     ```
       add_action( 'wp_enqueue_scripts', 'custom_dequeue_styles', 11 );
       function custom_dequeue_styles() {
           if (get_the_ID() != 1) {
       		wp_dequeue_style( 'wpsl-styles' );
           }
       }
       ```
   
 * Place the above code snippet in your active theme’s functions.php file and replace
   the “1” in the conditional statement with the id of the post or page where you
   have used the [wpsl] shortcode.
 * I hope that helps!
    Regards,
 *  Thread Starter [Sean Thompson](https://wordpress.org/support/users/seanthompson/)
 * (@seanthompson)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/dequeue-stylesheet/#post-16111369)
 * Got it working with:
 *     ```
       function otw_remove_map_style() {
   
           if(!is_page('dealers')) {
   
               wp_dequeue_style( 'wpsl-styles' );
   
           }
       }
       add_action( 'wp_enqueue_scripts', 'otw_remove_map_style', 11 );
       ```
   
 * Thank you.
 *  [farroyo](https://wordpress.org/support/users/farroyob/)
 * (@farroyob)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/dequeue-stylesheet/#post-16113486)
 * Cool!
 * Yes, I forgot to mention that you could also use the page slug, your solution
   is even better 🙂
 * Regards,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Dequeue Stylesheet’ is closed to new replies.

 * ![](https://ps.w.org/wp-store-locator/assets/icon-256x256.jpg?rev=1007784)
 * [WP Store Locator](https://wordpress.org/plugins/wp-store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-store-locator/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [farroyo](https://wordpress.org/support/users/farroyob/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/dequeue-stylesheet/#post-16113486)
 * Status: not resolved