Title: Remove generated style
Last modified: April 9, 2022

---

# Remove generated style

 *  Resolved [وردپرس ایرانی](https://wordpress.org/support/users/masoudnkh/)
 * (@masoudnkh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/)
 * Hi,
    i have issue with generated style by essential addon. The plugin may not
   able to remove style by fixed id like **essential-style**. i have huge css file
   loaded in my product page : wp-content/uploads/essential-addons-elementor/734e5f942.
   min.css how to remove this file from all product page? this style loaded with**
   c966f2ad0 **id and removed by this code from only one product page but loaded
   with another id on other page: `wp_deregister_style( ‘c966f2ad0’ );

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

 *  Plugin Support [Abid Hasan](https://wordpress.org/support/users/abidhasan112/)
 * (@abidhasan112)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/#post-15544185)
 * Hi there,
 * Hope you’re doing good.
    Since our asset file is dynamic you can use `eael_generate_assets`
   hook and write your own code in `functions.php`:
 *     ```
       add_action('eael_generate_assets',function($uid, $file_path){
       if(check is it product page or not){
       wp_deregister_style( $uid );
       }
       });
       ```
   
 * **NOTE for you and future reference of this topic:** Please don’t paste the above
   code directly on your **functions.php**. You need to change the product page 
   check inside if condition and filled with the values. I believe you have a development
   knowledge to execute/use the above code.
 * Thank you!
 *  Thread Starter [وردپرس ایرانی](https://wordpress.org/support/users/masoudnkh/)
 * (@masoudnkh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/#post-15544273)
 * Do you mean that the code is like this?
 *     ```
       add_action('eael_generate_assets',function($uid, $file_path){
       	if( is_product() ){
       		wp_deregister_style( $uid );
       	}
       });
       ```
   
 * Yes, I understand, but to a lesser extent, because I did not learn PHP for a 
   long time. Thank you for giving me the complete code.
 *  Plugin Support [Abid Hasan](https://wordpress.org/support/users/abidhasan112/)
 * (@abidhasan112)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/#post-15544284)
 * Hi [@masoudnkh](https://wordpress.org/support/users/masoudnkh/) ,
 * You can directly check the product page ID/SLug inside if condition by following
   this: [https://developer.wordpress.org/reference/functions/is_page/](https://developer.wordpress.org/reference/functions/is_page/)
 * Cheers!
 *  Thread Starter [وردپرس ایرانی](https://wordpress.org/support/users/masoudnkh/)
 * (@masoudnkh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/#post-15544301)
 * I used ** if (is_product () ** but the style is still loading on product page.
   
   Deleting by page ID is too much code and I have to specify more than 1000 pages.
   I need a code that automatically deletes the file generated by your plugin for
   all pages
 *  Plugin Support [Abid Hasan](https://wordpress.org/support/users/abidhasan112/)
 * (@abidhasan112)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/#post-15546203)
 * Hi [@masoudnkh](https://wordpress.org/support/users/masoudnkh/) again,
 * Could you please share one of your page URL so that I can deeply check that template
   and assist you with this?
 * Thank you!
 *  Thread Starter [وردپرس ایرانی](https://wordpress.org/support/users/masoudnkh/)
 * (@masoudnkh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/#post-15546887)
 * Hi [@abidhasan112](https://wordpress.org/support/users/abidhasan112/)
    I’m sorry,
   the page is not online and I’m working on localhost I will build an online site
   as soon as possible In general, the plugin generates a CSS file for each page
   and this file does not have a fixed ID and is different for each page, ie for
   one page it is 43236346-CSS and for another page it is 35723534-CSS. Now I want
   to remove the production or call of this file from the product pages in general.
   There are many products and it is not possible to write code for each page. The
   code you provided did not work Are you sure the code you gave me is working correctly?
   Or if the code is correct, does a special change need to be made or is the code
   itself OK and should only be a condition of the product page?
 *  Plugin Support [Abid Hasan](https://wordpress.org/support/users/abidhasan112/)
 * (@abidhasan112)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/#post-15547053)
 * Hi [@masoudnkh](https://wordpress.org/support/users/masoudnkh/) ,
 * Generally, EA doesn’t load assets to random pages. If any EA widget exists on
   your Single Product Page Template, it will generate the assets. So we need to
   check on your template if any EA widget exists or not actually.
 * So that would be great if you live your website(if possible in staging) so that
   we can look into it.
 * Besides that, we’re trying to provide the proper code to dequeue the assets files
   from the product pages. I will post here if we can able to do this on our end.
 * Thank you!
 *  Plugin Support [Abid Hasan](https://wordpress.org/support/users/abidhasan112/)
 * (@abidhasan112)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/#post-15549838)
 * Hi there again,
 * Could you please add this code to `functions.php` file:
 *     ```
       function __dequeue_eael_product_page_asset() {
          if ( defined( "EAEL_PLUGIN_FILE" ) ) {
             if ( is_product() && ( is_single() || is_page() || is_singular() ) ) {
                $uid = substr( md5( 'singular-' . get_queried_object_id() ), 0, 9 );
                wp_dequeue_script( $uid );
                wp_dequeue_style( $uid );
             }
          }
       }
   
       add_action( 'wp_enqueue_scripts', '__dequeue_eael_product_page_asset', 11 );
       ```
   
 * This will dequeue the EA assets from your Single Product page template.
 *  Thread Starter [وردپرس ایرانی](https://wordpress.org/support/users/masoudnkh/)
 * (@masoudnkh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/#post-15551874)
 * Thank you
    The code works well It would be great if you could make changes in
   the next versions so that only the required styles and scripts are loaded on 
   each page, because this plugin loads 1 CSS file with a size of more than 1 MB
   on that page and reduces the speed of the site. If even 1 widget is used on a
   page. For example, if a page uses only the Creative Button widget on the page,
   the code for the same widget will also be loaded on the page. This will double
   the value of your good plugin
    -  This reply was modified 4 years, 2 months ago by [وردپرس ایرانی](https://wordpress.org/support/users/masoudnkh/).
 *  Plugin Support [Abid Hasan](https://wordpress.org/support/users/abidhasan112/)
 * (@abidhasan112)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/#post-15553514)
 * Thanks, [@masoudnkh](https://wordpress.org/support/users/masoudnkh/) for your
   suggestion.
    We will keep improving our plugin and our assets system.
 * Thank you!

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

The topic ‘Remove generated style’ is closed to new replies.

 * ![](https://ps.w.org/essential-addons-for-elementor-lite/assets/icon-256x256.
   gif?rev=3182943)
 * [Essential Addons for Elementor - Popular Elementor Templates & Widgets](https://wordpress.org/plugins/essential-addons-for-elementor-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/essential-addons-for-elementor-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/essential-addons-for-elementor-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/essential-addons-for-elementor-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/essential-addons-for-elementor-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/essential-addons-for-elementor-lite/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [Abid Hasan](https://wordpress.org/support/users/abidhasan112/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/remove-generated-style/#post-15553514)
 * Status: resolved