Remove Unused JavaScript & CSS
Start by reviewing and removing any unsed CSS or JavaScript across your site’s infrastructure. Employ DevTools “Coverage” capabilities to quickly scan & find unused code or scripts. Of course, global CSS files and JavaScript elements can remain hidden on the site – even after a full-analysis is complete. Be careful when deleting or optimizing your site’s code – especially when you’re working manually. Follow dead code elimination standards and requirements to reliably preserve site performance. Carefully remove unsed CSS files and JavaScript elements to minimize site render-blocking.
https://perfmatters.io/docs/delay-javascript/
https://perfmatters.io/docs/remove-unused-css/
Eliminate Render-Blocking Critical CSS
Eliminate render-blocking CSS resources to make your site fast, reliable, and powerful. Prioritize critical path CSS efficiency – which applies to all above-the-fold elements. Focus on finding & extracting CSS code that impacts content on different viewpoints. Additionally, inline all CSS code written within the post or page header tag. Any non-critical CSS should be deferred to eliminate render-blocking stylesheets. Ensure you’ve eliminated any render-blocking critical CSSto maximize site speed and performance.
Concrete Your CSS Files
You may need to combine all the CSS files. There are some interesting resources on how to remove unused CSS from elementor. However, you might check your Google Search Console and find that most of your crawl budget was being eaten by CSS files. If that’s the case, anyone would want to know how to combine all css files into one.
Confirmed – It’s not Elementor template. That’s how all the sites are.
Confirmed – It’s not the hosting because it loads the same or worse on Kinsta.
Confirmed – It’s not an issue with other plugins.
Confirmed – The elementor system info shows running properly
Use a staging environment to test lightly and quickly.
What I found works is:
- Javascript Deferred Except JQuery and Tracking Scripts
- Javascript Delayed Except JQuery and Tracking Scripts
- Remove Unused CSS (Loaded by file in Perfmatters)
- Enable CCS Print Method -> Internal Embedding
- Enable Optimized Image Loading, Gutenberg Loading, Lazy Load Bg Images
- Preload JQuery and Main Image
- DNS Prefetch Tracking domains
- Exclude Elementor From Delayed CSS (forms will not work)
Other considerations:
- Optimizing all icons
- Optimizing delivery of fonts
- Optimizing unnecessary scripts
- Optimizing development containers
Remember to regenerate files and data for Elementor, and clear the used CSS for the website. Then, you will want to purge the edge cache and object cache from the server side.
This is one of the best resources I could find on the web: https://www.reddit.com/r/elementor/comments/uiiyc2/how_to_get_perfect_lighthouse_scores_with/
Instructions received from Elementor Support Team:
Hi Chad,
Thank you for your reply! Could you perform these and see if it helps?
Please make sure to back up your entire site as a matter of precaution before performing troubleshooting steps.
- Deactivate all plugins except Elementor, Elementor Pro, and Temporary Login.
- Update Elementor, Elementor Pro, and Hello Elementor Theme; re-check the issue.
Should the issue persists, kindly proceed with these:
- Go to WP Dashboard > Elementor > Settings > Performance > CSS Print Method > Internal Imbedding > Save Changes.
- Go to Elementor > Tools on your WordPress dashboard. Click Regenerate CSS & Data.
- Clear all the cache memory, which includes your browser’s cache, other plugins’ cache, and server cache (if possible).
I hope this helps!
Best regards,
That didn’t help. So I asked about the number of CSS files. They replied:
Hi Chad,
Thank you for reaching out!
Yes, it is normal for Elementor, especially with Elementor Pro and additional plugins, to load multiple CSS files since each widget and feature often comes with its own stylesheet. This helps ensure flexibility and modular functionality across different design elements. However, having too many CSS files can sometimes impact your site’s loading speed, depending on your hosting environment, caching settings, and optimization techniques.
Upon checking your website, all widgets and pages appear to be functioning correctly, and there are no immediate issues or alerts regarding performance.
If you have any other clarification don’t hesitate to message us.
Best regards,
And once again they replied:
Hi Chad,
Thank you for quick reply!
Yes, limiting the number of widgets can help reduce the number of CSS files, but there are also other ways to optimize your site’s performance. Increasing your site’s memory limit can improve overall speed, and enabling internal CSS embedding by going to Elementor > Settings > Advanced and setting the CSS Print Method to Internal can help reduce external CSS requests.
You can also use optimization plugins like 3rd Party WP Rocket or Autoptimize to combine and minify CSS files, which will lower the number of separate requests. While reducing widgets is a good step, combining it with these techniques will make a bigger difference in improving your site’s speed.
Please let me know if this helps!
Best regards,