Plugins should work only on their respective pages. But sometimes they will show up on each and every page of your website. This increases unnecessary requests every time a page is loaded. These unused requests will increase page loading time for your site. You also receive a lower page score on Google’s Page Speed insights. It is always better to load only what is necessary by disabling unnecessary plugin requests on that page. So, here is everything you need to know about disabling plugins on specific posts and pages.
Generally, there are multiple ways to stop it. Either add custom plugin filters to each plugin to disable it or, simply use a free plugin (which we will discuss) and your unnecessary page requests will stop.
There are some premium plugins that can also be used that also have other functionalities for speeding up WordPress. You can try our free method first and then jump for premium if you are not satisfied.
There are some things to be taken care of while disabling plugins for specific pages. You may break your site and its functionalities, during this process and in order to recover back, it would take time if your site is plugin loaded.
We strongly recommend taking a complete backup of your site and storing it somewhere offline for future access.
Custom Coding Method
Here you have to search for optimization codes for each and every plugin on the internet. Once you get them, you will use them in the plugin editor or theme functions file. Sometimes they work and sometimes won’t.
It comes with a huge risk. Some codes may break your site, and they may also increase vulnerability if any deprecated (old and unused) functions are used in those codes.
We never suggest you follow this method if you don’t have much time to manage your sites, check their integrity every now and then. Better use plugin method.
Free Plugin Method
As already mentioned, there are multiple plugins. This free plugin worked the best for us. We have also used premium ones like Perfmatters and Asset Cleanup. Here we will discuss only the freeway.
First, let us download the plugin from WordPress Repository, Freesoul Deactivate Plugins – Plugin manager and cleanup. A sincere thanks to its developer Jose Mortellaro for developing such a wonderful plugin.
Here is this tutorial, I will be testing this on the ‘Contact Form7 Plugin’, which loads on each and every page even though it should be loading only on the ‘Contact Us’ page of the website.
The plugin may be uncomfortable to navigate in the beginning. But once you understand what its options are, it will be a breeze to operate, satisfying to see how this plugin makes page loading faster than before.
When you start to configure this plugin, it will show all the plugins installed on the website. You can disable plugins for All Pages/ Specific Pages/ Archives/ Product Pages/ Product Archives/ Post Archives/ Post Singles.
Recently the author has added features to disable plugins based on devices. If you want to block something on mobile, but want to allow it on PC, you can do it.
Below is the Dashboard look of the plugin. The below screenshot has been captured from one of the E-Commerce sites we designed. We used Freesoul Plugin to disable some resource-heavy plugins from being loaded on Non-Ecommerce Pages.
At the Top is the Navigation to select Website Locations like Page, Post, Archive, Shop, etc. Once you select the right post type, you can then proceed to disable plugins.
There are some options to activate/ disable all at a single time. It is not important right now.
Below the navigation, you can see all the list of Plugins that you use on your website. It will be listed in series. ie., side by side. Below that you can see many rows. They are nothing but post types you selected in the plugin navigation. The corresponding boxes in the above image are blank if any property is not selected.
If you click on the button in the left of ‘post types’, the whole row will get selected. Which will now have a darker color for the boxes by default, which means that the plugin is already active for the selected ‘post type’.
In the above example,
For the About Page, ‘Coupon Generator’ and ‘Duplicate Page’ Plugins are disabled, rest are enabled.
For Cart Page, Only ‘Disable Dashboard’ is disabled, the rest are all enabled.
For the Checkout Page, you can see that the ‘Duplicator’ Plugin is unchecked. But the options for Checkout are kept off. Hence this rule will not work.
For the Contact Us Page, ‘Aryo’ and ‘String’ Plugins are disabled, the rest are all enabled.
Now I assume you have understood how the plugin works. Here is a small demonstration.
Testing FreeSoul Plugin
We have installed ‘Contact Form7’ for our test site. These are the requests the site made before and after Activating that Plugin.
Now when the FDP is Activated, and if CF7 is disabled for that Page, all the requests will be disabled and the Page Request count will be as before. In our case, there were only 9 requests on the test page.
Use Plugins only when necessary. Instead of disabling them on each and every page, purchase/install only well-coded plugins.
In the FDP Plugin, Disable only those Plugins that create extra unused requests. If a plugin is doing fine, it means it is well coded and you don’t have any necessity to block it on any pages/ posts.
If you are using this on E-Commerce sites, you may break the site if you disable the required ones. Example: If you use the ‘wishlist’ plugin with its ‘plugin generated’ icon on the top of your website, and if it’s disabled for other pages except for the ‘wishlist’ page, then you should either remove that icon or provide a custom link to the wishlist page.
When on a different page, when clicked on the Wishlist Icon, if some function gets activated related to the plugin, it simply will not work in your case as you have disabled it completely for that page.
If you are using custom login plugins for woo-commerce, you cannot disable them at all. Customers should have the ability to login from any screen.
If this article was useful, please let us know in the comments. If you have any problems, let us know. We try our best to solve them.