Customize Remove Unused CSS parameters

You can change the number of URLs per batch, and the CRON interval of the Remove Unused CSS optimization. This might help to reduce the CPU usage in those cases where it is caused by this optimization.

We have two filters to achieve this:

  • rocket_rucss_pending_jobs_cron_rows_count : A lower value (default is 100 URLs) can help the server to work on fewer requests at a time.
  • rocket_rucss_pending_jobs_cron_interval : By setting a higher value (default is 60 seconds), the server will have more time to rest between processing batches.

You can use this helper plugin to achieve it:

📥 Download (.zip): WP Rocket | Change Remove Unused CSS Parameters

Developers: You can find the code for this plugin on GitHub.

Important! You must edit the helper plugin before use!

Only install this plugin if you are comfortable editing files via (S)FTP! This plugin itself works; however, in case something conflicts in your custom environment, you might need to remove this plugin manually via (S)FTP and edit your .htaccess directly.

Instructions to use this helper plugin

  1. Set your custom values by editing:
    • Line 26, to set the batch size. It is the number of URLs that will be processed on each run. Default is 100.
    • Line 46, to set the desired cron interval in seconds. It is the pause that will be applied between batches processing.
  2. Compress it as ZIP, upload and activate the helper plugin
  3. Changes will be applied the next time you clear the Used Css and the generation is triggered again
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.