Title: deregister_styles
Last modified: March 22, 2019

---

# deregister_styles

 *  Resolved [fedehtm](https://wordpress.org/support/users/fedehtm/)
 * (@fedehtm)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/deregister_styles/)
 * Hi Tobias, I’m trying to deregister the CSS from TablePress in every pages but
   the one which uses it.
 * The code I’m looking for will be similar to this:
 *     ```
       add_action( 'wp_print_styles', 'cf7_deregister_styles', 100 );
       function cf7_deregister_styles() {
           if ( ! is_page( 'contacto' ) ) {
               wp_deregister_style( 'contact-form-7' );
           }
       }
   
       add_action( 'wp_print_scripts', 'cf7_deregister_javascript', 100 );
       function cf7_deregister_javascript() {
           if ( ! is_page( 'contacto' ) ) {
               wp_deregister_script( 'contact-form-7' );
           }
       }
       ```
   
 * (in the above case, I deregister both CSS and Js for Contact Form 7 plugin.)
 * I’m willing to do the same with your plugin with a different page (/lista-de-
   precios), but the only filter I’ve found in the forum is
 * `add_filter( 'tablepress_use_default_css', '__return_false' );`
 * How can introduce a function which in my “if block” which unloads the Js and 
   CSS of your plugin.
 * Thank you in advance. Your plugin is excellent.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fderegister_styles%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/deregister_styles/#post-11343639)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * You are on the right track here. Basically, you’ll just have to replace `__return_false`
   with your own function.
 * For some inspiration, please see [https://wordpress.org/support/topic/enable-tablepress-resources-only-on-pages-that-use-them/#post-8645623](https://wordpress.org/support/topic/enable-tablepress-resources-only-on-pages-that-use-them/#post-8645623)
   and [https://wordpress.org/support/topic/dequeue-style-files/](https://wordpress.org/support/topic/dequeue-style-files/)
 * Regards,
    Tobias
 *  Thread Starter [fedehtm](https://wordpress.org/support/users/fedehtm/)
 * (@fedehtm)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/deregister_styles/#post-11343683)
 * Thank you Tobias, that link is the one I was looking for.
 * PERFECT.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/deregister_styles/#post-11343696)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](https://wordpress.org/support/plugin/tablepress/reviews/#new-post)
   here in the plugin directory. Thanks!

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

The topic ‘deregister_styles’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [dequeue](https://wordpress.org/support/topic-tag/dequeue/)
 * [js](https://wordpress.org/support/topic-tag/js/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/deregister_styles/#post-11343696)
 * Status: resolved