Improve Site Performance with a Plugin Audit
Run a plugin audit to improve your site's performance

Speed up your site by paring down the plugins

Are you still using all those features?

One of the reasons is so popular and widespread is the ability to expand its feature set with plugins. There are nearly countless options the expand your site’s functionality available through the WordPress repository, sold by third parties, and the options become truly limitless when you account for custom plugin development as well. It’s easy to get overzealous with plugins, adding functionalities you may or may not need actually need. But when choosing the plugin suite for your WordPress site, it’s important to remember the cost. Even if all the plugins you choose are free to use, each one adds something else that must be loaded onto your site. Oftentimes too, it’s not just one file. You’ll have the plugin functionality files, CSS and JavaScript files for the plugin specifically, and sometimes even more. All of these files have to be loaded by your website, and the “weight” of it all can quickly start to drag down your site. If you’re already at that point, we recommend running a plugin audit to make your site lean, mean, and lighting-fast once again.

Evaluate what you regularly use

With their quick plug-and-play nature, it’s easy to keep adding new plugins, even if you’re actively replacing an old functionality. Maybe you’re upgrading from WPForms to Gravity Forms or expanding your WooCommerce store. No matter the circumstances, we recommend taking a moment to evaluate whether your new plugin can or does replace the functionality of a different plugin that was on your site. It can be tempting to leave the old plugin on your site “just in case,” but every new file adds to the overall weight of your site and drags down the loading time. Remove that old plugin, and if you really need it back, it’s likely just a quick repository search away.

If you’re not adding new plugins, but instead running an audit, run through your list and take note of what you use each plugin for. Specifically, are you using every facet of the plugin? One of our most common examples comes from the JetPack plugin. It offers an extensive feature set: security, caching, eCommerce taxes, and more. But any piece that your site isn’t using is still loaded in the heavy plugin files. Some sites use the entire feature set of the plugin, which is great for keeping everything condensed and in one place. But if you’re only using the caching feature, there are much more “narrow”, lightweight plugins like WP Rocket that can do the same thing without having to load in the files for functionalities like taxes that you’re not even using.

Specify where to load plugin files

Some plugins are absolutely crucial for your website…on one or two pages. But by default, WordPress loads the plugin files on every page, even if that functionality isn’t required. This doesn’t mean you have to shrug your shoulders and say “oh well”, though! With just a few lines of code in your theme, you can tell your site to only load those files on certain pages: the ones where the plugin is really needed. The rest of the site then doesn’t have to load the files, and you reduce the overall weight and load time.

Using the wp_print_scripts and wp_print_styles hooks, you can generate a list of all the CSS and JavaScript files that your site is loading. Most of these will be named in a way that makes it obvious what plugin is generating them. Using those names, you can then edit the function from the same print_ hooks with a couple of new functions: wp_dequeue_script and wp_deregister_script (replacing script with style for CSS files, as well). The code to exclude scripts on all pages except one would look something like this:

function dequeue_unnecessary_scripts() {
// If the user is an admin, display the enqueued scripts - REMOVE THIS WHEN YOU'RE DONE AUDITING THEM
if ( current_user_can('administrator') ) {
global $wp_scripts;
$enqueued_scripts = array();
foreach( $wp_scripts->queue as $handle ) {
$enqueued_scripts[] = $wp_scripts->registered[$handle]->src;

// Find the page we're on
$page_id = get_queried_object_id();
// If we're not on the page where we want to use the scripts, then stop them from loading
if ( 101 != $page_id) {
add_action( 'wp_print_scripts', 'dequeue_unnecessary_scripts' );

And then you would duplicate this hook for any styles you want to remove, as well.

Simplify with custom plugins

Sometimes though, the above steps just aren’t enough. Maybe the functionality you need is only available inside a massive, multi-faceted plugin. And you can’t deregister its scripts, because they’re used all throughout the site. Except you’re not stuck! It’s important to remember that you can always develop a custom plugin. The upfront cost may be a bit higher to create a plugin for a specific functionality, but it may be worth it when accounting for page speed. Besides, that’s not the only benefit of a custom plugin, either. Custom plugins can be tailored to your exact needs: if the public plugin you found is just “good enough,” a custom plugin is designed to be the perfect fit. A custom plugin doesn’t have to be just one feature, either. You can combine multiple functionalities into one plugin, and reduce the overall weight of your site even more. And on top if it all, in a custom plugin, the developer can exclude scripts and styles from loading where they’re not needed right inside the plugin itself. While it may be the most upfront cost, it’s hard to beat the precise nature of a custom plugin for both performance and exact functionalities.

Need help running a plugin audit, or want to have a custom one developed? Don’t hesitate to reach out to Mr. WPress today for a free quote! Custom plugins are one of our specialties, and we love creating custom solutions tailored to our client’s needs.