Some time ago, I mentioned about Plugin Organizer and the benefits of loading plugins on pages when we only need them as we want to decrease page size and make our WordPress pages load faster, especially if we use a cache plugin such as W3 Total Cache.
However, there are situations when we need a plugin on a page or we use a theme, but some of the CSS and JavaScript files are not needed. Imagine a contact page where you only have some text and a form and you are using a theme that loads plenty of useless CSS and JavaScript files. Not ideal for our website visitors that should enjoy a faster page load.
I’ve decided to write my first official free plugin and share it with the WordPress community.
WP Asset Clean Up scans the page you’re editing, detects the loaded scripts and styles and shows them in a list where you can choose the ones that you don’t want to load.
What are the benefits of using this plugin?
- The HTTP requests on your website will decrease thus saving you bandwidth (good, if you don’t have unlimited with your host) and your pages will load faster
- In case there are conflicts between scripts (from plugins/themes) that are loading on the same page, you can remove the ones that you don’t need, thus minimising the risk of JavaScript errors. If you’re a developer, you know how much headache you can have when you’re debugging errors on a page that have 20 .js files loaded from various plugins (and you only need 5 of them).
- The HTML source code will be smaller, cleaner and easier to read when you’ll need to find something.
- The Apache log files will also be smaller and easier to read since less requests will be made to the server.
This plugin is powerful in combination with a cache plugin that also combines the remaining loaded assets (.css and .js files) to minimize the number of HTTP requests.