Beware the Bloat of Stock WordPress Themes

Published: 1.30.16 · Views: 78

Theme Bloat

When spinning up a cheap budget WordPress site, it is common and far more affordable to purchase a stock premium WordPress theme from a marketplace like Themeforest than to build a custom theme. The quality of these themes vary widely; but, with adequate research, I have been able to find pretty solid themes for not a lot of money over the years. The theme this site used to run, Readme, is a phenomenal, lightweight theme that still packs a good number of features. Furthermore, their ongoing support has been excellent.

Any theme made for the broad market has features that not everyone will use. Readme, for example, includes a lot of jQuery and CSS files for interesting features; however, I am choosing not to use many of them at this time. Even though a theme does not use the features, is still instructs WordPress to load up all these extra files to my clients increasing page load time and wasting bandwidth.

Eliminating the Bloat

So, by stepping through each .js and .css file loaded, I determined which files I needed for the current feature set that I am using and eliminated the rest. Deregistering unneeded scripts and styles is relatively simple, assuming you have a child theme setup already. For example, in the snippet below I remove the share button feature by deregistering its script and style in my child theme’s functions.php.

After eliminating this batch of CSS and jQuery plugins, I do see some moderate improvements. It does not work magic, but why load that extra ~100kb of data and process an additional seven server requests when they are not needed at all? If you are running a WordPress stock theme and looking to get an extra ounce of performance, I recommend trying this out.