Title: Remove plugin&#039;s CSS file
Last modified: August 20, 2016

---

# Remove plugin's CSS file

 *  Resolved [asterbird](https://wordpress.org/support/users/asterbird/)
 * (@asterbird)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/)
 * First of all, thanks for this plugin! I love how simple and lightweight this 
   is.
 * I would like to make it even more lightweight by removing the plugin’s CSS and
   using my theme’s CSS instead.
 * How do I remove Simple Colorbox’s CSS file? I am using Theme1 (by default) and
   noticed that it’s being called in the plugin’s index.php via this code:
 *     ```
       public function __construct() {
       	// Add action hooks
       	add_action( 'wp_enqueue_scripts', array( $this, 'external_css' ) );
       	add_action( 'wp_enqueue_scripts', array( $this, 'external_scripts' ) );
       	add_action( 'wp_head',            array( $this, 'simplecolorbox_ad' ) );
       	add_action( 'wp_head',            array( $this, 'inline_scripts' ) );
       }
       ```
   
 * Commenting out the first add_action accomplishes exactly what I want. However,
   I would rather not hack the plugin code itself.
 * Any way to do this?
 * [http://wordpress.org/extend/plugins/simple-colorbox/](http://wordpress.org/extend/plugins/simple-colorbox/)

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

 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/#post-3550232)
 * Ohh, interesting idea. The code is written in a way that would prevent you from
   doing that.
 * If you change the code `new Simple_Colorbox()` to `$simple_colorbox = new Simple_Colorbox()`
   then you will be able to unhook the CSS files.
 * I’ll try to find some time to do this either today or tomorrow, although my schedule
   is busy, so it might need to wait until Wednesday. Feel free to pester me by 
   posting back here, as I’ll get an email notification then 🙂
 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/#post-3550277)
 * I’ve released version 1.3 which sets the variable to the class for you.
    [http://ryanhellyer.net/](http://ryanhellyer.net/)
 * If you need a hand working out how to unhook the styles, just let me know.
 * Depending on what exactly you are doing, you may just want to copy the main class
   out of the plugin and use that directly instead though, perhaps in a custom plugin.
 *  Thread Starter [asterbird](https://wordpress.org/support/users/asterbird/)
 * (@asterbird)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/#post-3550389)
 * Where is version 1.3? I couldn’t find it on your website.
 * I’m not sure how to unhook the files. If you could give me a hand, that would
   be great. Do I use enqueue or something?
 * I’m using the plugin on a client’s site – test site is [here](http://www.hr.sarah-moyer.com).
   I’m using it for all linked images and galleries. It’s the only javascript functionality
   I need for the site.
 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/#post-3550390)
 * Oh shoot! It never uploaded. Oops. I’ll fix that shortly.
 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/#post-3550391)
 * It’s now uploaded …
    [http://wordpress.org/extend/plugins/simple-colorbox/](http://wordpress.org/extend/plugins/simple-colorbox/)
 * For some reason half the files never uploaded and that prevented the repository
   from refreshing itself with the latest version.
 *  Thread Starter [asterbird](https://wordpress.org/support/users/asterbird/)
 * (@asterbird)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/#post-3550392)
 * Thanks! I upgraded Simple Colorbox to 1.3. Now how to unhook the CSS? I added
   this to my theme’s functions.php file, but I don’t think it’s right:
 *     ```
       function remove_simple_colorbox_css() {
       	remove_action('wp_enqueue_scripts', 'external_css');
       }
       add_action('wp_enqueue_scripts', 'remove_simple_colorbox_css', 1);
       ```
   
 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/#post-3550393)
 * That won’t work as it’s inside a class. You need to dequeue it from the object.
 * I’ll write some code for you later on. I need to go to a party right now, but
   will be back online later this evening. If I don’t reply to this within the next
   12 hours then I’m either too drunk or I forgot. Either way, post back here so
   I get an email notification alerting me to the fact that I haven’t come back 
   to help you yet.
 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/#post-3550396)
 * I wrote up a blog post for you explaining how to dequeue the CSS file. If you
   experience any problems implementing it then please let me know.
 *  Thread Starter [asterbird](https://wordpress.org/support/users/asterbird/)
 * (@asterbird)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/#post-3550406)
 * With 1.3.1 update, I was able to implement the code from your blog post – works
   great now!
 * Thanks so much for spending all this work and time helping me.
 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/#post-3550407)
 * Awesome 🙂

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

The topic ‘Remove plugin's CSS file’ is closed to new replies.

 * ![](https://ps.w.org/simple-colorbox/assets/icon-128x128.png?rev=1050323)
 * [Simple Colorbox](https://wordpress.org/plugins/simple-colorbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-colorbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-colorbox/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-colorbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-colorbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-colorbox/reviews/)

## Tags

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

 * 10 replies
 * 2 participants
 * Last reply from: [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/remove-plugins-css-file/#post-3550407)
 * Status: resolved