Need to disable plugins on specific pages in WordPress?
To selectively disable plugins on specific pages in WordPress, install the Asset CleanUp or Perfmatters plugin and use the script manager to disable plugins from specific content. RegEx can be used to disable plugins using URL patterns. You can also do this with CSS, JS, and fonts.
The most common example is disabling the contact form plugin on your entire website except your contact page. But it doesn’t stop there; you can disable sliders, social sharing, and affiliate link plugins where they aren’t being used. I listed quite a few common examples in this tutorial.
How To Disable Plugins On Specific Pages
1. Install The Asset CleanUp Plugin
Asset CleanUp is free while Perfmatters is a premium plugin by Kinsta, but Perfmatters has quite a few more speed optimization features than Asset CleanUp. For the sake of being free, I will use Asset CleanUp in the example. It has great reviews, so go ahead and install the plugin.
2. Disable Unused Plugins On Specific Pages
Edit a page or post and scroll down to the Asset CleanUp section.
Another option is to disable a plugin site-wide, and only enable it on certain pages:
3. Use RegEx To Disable Plugins By URL
RegEx (regular expressions) let you enable/disable plugins by URL.
This is only included with the premium version of Asset CleanUp, and Perfmatters.
To disable a plugin on that page, toggle the status to off and you will have 3 options. This example uses my review schema plugin which is only used on all URLs containing the word “review.” In this case, I would use the third option: enable my review plugin on all content containing the word “review” then use RegEx to disable it everywhere else. Just one example.
Disable plugin on current URL:
Disable plugin using RegEx:
Enable plugin using RegEx, and disable it everywhere else:
4. Configure Asset CleanUp Settings
Another way to disable plugins on certain pages and posts is with Perfmatters.
Install the plugin, go to a page or post, and click Script Manager.
Choose to disable the plugin everywhere, on the current URL, or use RegEx:
Perfmatters has other speed optimizations only these (in my opinion) are much more helpful and robust than Asset CleanUp. It can help you limit post revisions, disable autosaves, host Google Analytics locally, disable WordPress heartbeat, and more. It basically takes care of the “last 10% of speed optimization.” Perfmatters was developed by Kinsta, so you know it’s good.
6. Swift Performance
Swift Performance is a cache plugin that also has an plugin organizer.
You can find it in under Settings > Plugin Organizer.
There are tons of rules you can use to selectively disable plugins depending on the URL, whether it’s an Admin page, user role, and AJAX actions (helpful for WooCommerce sites).
7. Plugin Organizer
Plugin Organizer is one of the more popular ways to selectively disable plugins.
Head to settings and there are many options for selective loading plugins on admin pages, mobile, by user, and URL matching. Enable the options depending on what you’re trying to do.
Here’s a screenshot of the “post type” plugin settings to give you an idea of how it works:
Here’s a YouTube tutorial I found for Plugin Organizer:
8. Plugin Load Filter
Plugin Load Filter doesn’t have many reviews, but it’s super simple and does a great job.
Plugin Load Filter supports disabling plugins by post format type, custom post type, JetPack modules filtering, WP embed content, and URL filtering. Just go into the settings and toggle where you want each plugin to be disabled. It also has a few additional settings shown below.
9. Freesoul Deactivate Plugins
Freesoul Deactivate Plugins is another good option.
Just like you would with the other plugins, heading to the settings, select the type of content you want to edit (top tab), then enable or disable plugins on that content by toggling each one.
Here’s a glimpse of the custom URL settings:
Frequently Asked Questions
🔌 Which plugins let you selectively disable plugins?
Asset CleanUp and Perfmatters both let you selectively disable plugins from running on certain pages/posts. Asset CleanUp is free and Perfmatters is a premium plugin by Kinsta.
🔌 How do you use Regex?
Regex can be used with Perfmatters or Asset CleanUp's premium version. You can use it to disable plugins on specific URLs, for example all URLs including the word Review, or even category URLs.
🔌 Will selectively disabling plugins speed up my site?
Yes, it can significantly speed up your site. By looking at all plugins, scripts, and styles (eg. in Asset CleanUp) and comparing them to your GTmetrix Waterfall report, you can usually find and fix many plugins slowing down your site.
🔌 Which types of plugins take longest to load?
Social sharing, statistic, sliders, portfolios, page builders, calendars, chat, contact forms, related post are the most common culprits. I have a full list of 70+ common slow plugins.
Which One Do I Use To Disable Plugins On Pages?
I personally use Perfmatters by Kinsta since it’s very easy to use, comes with RegEx, and it also has tons of other miscellaneous optimizations that aren’t handle by WP Rocket (the cache plugin I use). The only speed plugins I have on my site are WP Rocket, Perfmatters, ShortPixel, and Breeze by Cloudways. Between these, that’s all you need to get 100% GTmetrix scores.
Have a question? Hit me up in the comments.