Title: How to remove inline CSS
Last modified: November 29, 2024

---

# How to remove inline CSS

 *  Resolved [cutu234](https://wordpress.org/support/users/cutu234/)
 * (@cutu234)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/how-to-remove-inline-css-3/)
 * The plugin loads quite a lot inline CSS that I am not a very big fan of. Can 
   we somehow remove it? I tried the standard WP action, but it didn’t work:
 * `wp_dequeue_style('xoo-wsc-style-inline');`
 * I prefer to keep inline CSS to a minimum, and I don’t see any good reason why
   it shouldn’t be added via the stylesheet.
 * Thank you!

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

 *  Thread Starter [cutu234](https://wordpress.org/support/users/cutu234/)
 * (@cutu234)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/how-to-remove-inline-css-3/#post-18168553)
 * Ah, got it. My mistake:
 *     ```
       wp_dequeue_style('xoo-wsc-style');
       wp_deregister_style('xoo-wsc-style');
       ```
   
    -  This reply was modified 1 year, 6 months ago by [cutu234](https://wordpress.org/support/users/cutu234/).
 *  Thread Starter [cutu234](https://wordpress.org/support/users/cutu234/)
 * (@cutu234)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/how-to-remove-inline-css-3/#post-18168571)
 * Ah, not yet! Unfortunately, this will also remove the main plugin CSS stylesheet,
   since both uses the same base for the ID.
 * How would I remove only the inline CSS, while keeping the main stylesheet?
 *  Plugin Author [xootix](https://wordpress.org/support/users/xootix/)
 * (@xootix)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/how-to-remove-inline-css-3/#post-18168652)
 * Hello [@cutu234](https://wordpress.org/support/users/cutu234/) 
   It isn’t added
   via stylesheet because its dynamic in nature. The CSS is generated from your 
   settings options and changes when you change the options.The few lines of inline
   CSS won’t do any harm but still if you want to remove it, you can use this PHP
   snippet.
 *     ```wp-block-code
       add_action( 'wp_print_styles', function(){    // Remove previous inline style    wp_styles()->add_data( 'xoo-wsc-style', 'after', '' );    } );
       ```
   
 * **However, you will need to first copy the generated inline CSS and paste it 
   in your custom stylesheet & you will need to repeat this every time you change
   a styling option in the settings.**
   There is another way to handle this & it 
   will need a plugin update from my end. This approach is followed by the plugins
   which require huge amount of inline styling such as Elementor, they dynamically
   generate CSS files.Initially, in our case there wasn’t a need for this because
   of few lines of inline CSS but over the period of time, the styling options have
   increased which led to increase in inline style, I still think its not that huge
   and won’t do any harm in performance, however, I am considering now to shift 
   to this method of generating dynamic CSS files.
    -  This reply was modified 1 year, 6 months ago by [xootix](https://wordpress.org/support/users/xootix/).
 *  Thread Starter [cutu234](https://wordpress.org/support/users/cutu234/)
 * (@cutu234)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/how-to-remove-inline-css-3/#post-18168691)
 * Awesome, thank you very much! That did the trick. Don’t get me wrong. I don’t
   think that a little bit inline CSS will do any harm. I just like to keep things
   tidy. For me, it’s much easier for maintenance. Most users will not even notice
   the inline CSS.
 * No need for major changes. I’m more than happy with the code snippet.

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

The topic ‘How to remove inline CSS’ is closed to new replies.

 * ![](https://ps.w.org/side-cart-woocommerce/assets/icon-256x256.gif?rev=3217170)
 * [Side Cart Woocommerce | Woocommerce Cart](https://wordpress.org/plugins/side-cart-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/side-cart-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/side-cart-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/side-cart-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/side-cart-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/side-cart-woocommerce/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [cutu234](https://wordpress.org/support/users/cutu234/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/how-to-remove-inline-css-3/#post-18168691)
 * Status: resolved