Title: Remove CSS from head
Last modified: May 4, 2018

---

# Remove CSS from head

 *  [James Hunt](https://wordpress.org/support/users/bonkerz/)
 * (@bonkerz)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/remove-css-from-head-3/)
 * Is there an option to disable the stylesheets with the plugin / remove the CSS
   inserted in to the head?

Viewing 1 replies (of 1 total)

 *  Plugin Author [wpdreams](https://wordpress.org/support/users/wpdreams/)
 * (@wpdreams)
 * [8 years ago](https://wordpress.org/support/topic/remove-css-from-head-3/#post-10270423)
 * Hi,
 * Unfortunately there is no option for that. Usually minify/cache plugins are used
   to remove the stylesheets.
 * With a custom code it might be possible, but please be careful. Add this custom
   code to the **functions.php** in your theme/child theme directory. Before editing,
   please make sure to have a full site back-up just in case!
 *     ```
       function asl_remove_styles() {
           global $wp_filter;
           if ( isset($wp_filter['wp_head'], $wp_filter['wp_head']->callbacks, $wp_filter['wp_head']->callbacks[10]) ) {
               foreach ( $wp_filter['wp_head']->callbacks[10] as $k => &$f ) {
                   if (
                       isset($f['function']) &&
                       is_array($f['function']) &&
                       isset($f['function'][1])
                   ) {
                       if ( in_array($f['function'][1], array('StyleSheets', 'handle', 'inlineCSS')) ) {
                           unset($wp_filter['wp_head']->callbacks[10][$k]);
                       }
                   }
               }
           }
   
           if ( isset($wp_filter['wp_enqueue_scripts'], $wp_filter['wp_enqueue_scripts']->callbacks, $wp_filter['wp_enqueue_scripts']->callbacks[10]) ) {
               foreach ( $wp_filter['wp_enqueue_scripts']->callbacks[10] as $k => &$f ) {
                   if (
                       isset($f['function']) &&
                       is_array($f['function']) &&
                       isset($f['function'][1])
                   ) {
                       if ( in_array($f['function'][1], array('StyleSheets', 'handle', 'inlineCSS')) ) {
                           unset($wp_filter['wp_enqueue_scripts']->callbacks[10][$k]);
                       }
                   }
               }
           }
       }
       add_action( 'wp_head', 'asl_remove_styles', 100 );
       add_action( 'wp_enqueue_scripts', 'asl_remove_styles', 100 );
       add_action( 'init', 'asl_remove_styles' );
       ```
   
 * Best,
    Ernest M.

Viewing 1 replies (of 1 total)

The topic ‘Remove CSS from head’ is closed to new replies.

 * ![](https://ps.w.org/ajax-search-lite/assets/icon-256x256.png?rev=3192672)
 * [Ajax Search Lite - Live Search & Filter](https://wordpress.org/plugins/ajax-search-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-search-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-search-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-search-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-search-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-search-lite/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [wpdreams](https://wordpress.org/support/users/wpdreams/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/remove-css-from-head-3/#post-10270423)
 * Status: not resolved