Title: Remove CSS On function does not work properly
Last modified: January 24, 2025

---

# Remove CSS On function does not work properly

 *  [ms100](https://wordpress.org/support/users/ms100/)
 * (@ms100)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/remove-css-on-function-does-not-work-properly/)
 * Hi support,
   The ‘Remove CSS On’ function does not seem to work properly.Maybe
   it has to do with this:
 *     ```wp-block-code
       /**
        * Common shared data and options.
        *
        * @param string $key
        * @return array
        */
       public static function get_common($key = '')
       {
           $_common = [];
           $_common['enable_on'] = [
               'all'         => esc_html__('All Pages', 'debloat'),
               'single'      => esc_html__('Single Post/Article', 'debloat'),
               'pages'       => esc_html__('Pages', 'delobat'),
               'home'        => esc_html__('Homepage', 'delobat'),
               'archives'    => esc_html__('Archives', 'delobat'),
               'categories'  => esc_html__('Categories', 'delobat'),
               'search'      => esc_html__('Search', 'delobat'),
           ];
       ```
   
 * does not completely seem to correspondent with:
 *     ```wp-block-code
       /**
        * Conditions test to see if current page matches in the provided valid conditions.
        *
        * @param array $enable_on
        * @return boolean
        */
       public function check_enabled(array $enable_on)
       {
           if (in_array('all', $enable_on)) {
               return true;
           }
   
           $conditions = [
               'pages'      => 'is_page',
               'posts'      => 'is_single',
               'archives'   => 'is_archive',
               'archive'    => 'is_archive', // Alias
               'categories' => 'is_category',
               'tags'       => 'is_tag',
               'search'     => 'is_search',
               '404'        => 'is_404',
               'home' => function() {
                   return is_home() || is_front_page();
               },
           ];
       ```
   
 * I am no coder so I could be wrong, but I do think the ‘Remove CSS On’ selection
   options do not work as they should.

The topic ‘Remove CSS On function does not work properly’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/debloat.svg)
 * [Debloat - Remove Unused CSS, Optimize JS](https://wordpress.org/plugins/debloat/)
 * [Support Threads](https://wordpress.org/support/plugin/debloat/)
 * [Active Topics](https://wordpress.org/support/plugin/debloat/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/debloat/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/debloat/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [ms100](https://wordpress.org/support/users/ms100/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/remove-css-on-function-does-not-work-properly/)
 * Status: not resolved