Deactivate Plugins Per Page - Improve WordPress Performance

Bluehost Shared Hosting

Deactivate Plugins Per Page - Improve WordPress Performance

Short Description

With “Deactivate Plugins Per Page” you can easily disable plugins on certain WordPress pages (or on all except a selected page).

This is useful for speeding up your site mainly because many front-end plugins will load their JavaScript and CSS assets on every page, even if you use them on one page.

How it works?

You can add deactivation rules for active plugins. For example for a contact form plugin, that you only use on the contact page, simply add a rule to deactivate it on all URI except on the contact page.

Deactivate Plugins Per Page - Improve WordPress Performance

Deactivate Plugins Per Page - Improve WordPress Performance

Deactivation Rules Options

1. Deactivation Type
- Deactivate on selected URI
- Deactivate on all URI except selected

2. URI selection type
- Page
- Custom

3. [Page] Select pages to extract URI from (it will update automatically if the page slug changes)

3. [Custom] Custom URI condition
- URI equals …
- URI does not equal …
- URI contains …
- URI does not contain …
- URI starts with …
- URI does not start with …
- URI ends with …
- URI does not end with …
- URI matches the regular expression …

Deactivate Plugins Per Page - Improve WordPress Performance

4. Affected devices
- All
- Desktop
- Mobile

Plugin Groups

Create groups of multiple plugins in order to add deactivation rules that affect them all.

Deactivate Plugins Per Page - Improve WordPress Performance

Debug Mode

Enable debug mode to see what is the URI and which plugins are active/inactive on the current page on the front-end. This will help you create rules and test current ones. A debug box will appear on the front-end if you are an administrator user.

Deactivate Plugins Per Page - Improve WordPress Performance

Does it affect the Back-end?

There is an option (not enabled by default) that makes all rules with Custom URI selection to also affect the back-end. Some back-end pages will still not be affected in order to avoid problems, like the pages that control plugin activation, deactivation, updates, and installation.

Export/Import Rules and Settings

Deactivate Plugins Per Page - Improve WordPress Performance

Since version 1.9.0 you can export all your deactivation rules and settings of the plugin and import them on another site. Rules with Page URI selection type, will be skipped if the same pages (both same ID and slug) do not exist on the destination site. In a multisite you can import into multiple sites at once.

Custom PHP function as condition

Since version 1.15.0 you can add the name of your own PHP function to a deactivation rule so it is used as an additional condition. The rule will only work if your function also returns true. The function must be loaded in a must use plugin so it is available before regular plugins load.

Client Reviews

Deactivate Plugins Per Page - Improve WordPress Performance

Precautions

Group plugins that work together

If you have a plugin that requires another plugin to be active in order to work, you need to add these plugins in a plugin group, and add deactivation rules to that group. Deactivating only one of these could lead to errors or the global deactivation of the other plugin.

Don’t deactivate plugins required by your theme

Some themes require certain plugins in order to work properly. If you deactivate these plugins you may experience problems.

Deactivation hooks will not run

When plugins are deactivated via my plugin, the actual deactivation function is not called, and the deactivation hooks will not run. Instead, to make it work per page, plugins are just dynamically removed from the list of active plugins before the page loads. This means that if a plugin has some actions that it performs when it is deactivated, these actions will not run when it is deactivated via my plugin.

For example, some plugins add code to your ”.htaccess” file when they are activated, and when they are deactivated, they remove it. In this case if you add a deactivation rule with my plugin to stop the plugin on a certain page, the ”.htaccess” code will still be there and work on that page, even though the plugin will not be active on it.

Don’t use this plugin to hide sensitive data

It is not made to work securely for that. It is mainly made for site speed optimization and it can also be used for debugging or solving plugin compatibility issues.

Backup your site

Deactivating plugins per page is not a natural thing for WordPress, and plugin and theme developers are not expecting that. It works great in most cases, but sometimes can lead to problems, to other plugins being deactivated or settings being changed. Always have a recent backup of your site and if you can, test your changes in a staging site.

Feedback / Support / Questions

Use the support section (requires sign-in), or my email nikolay@nikolaydev.com

Tested Up To

Deactivate Plugins Per Page - Improve WordPress Performance WordPress 6.7
Deactivate Plugins Per Page - Improve WordPress Performance PHP 8.2.6

Hire me to make a custom plugin for you

Deactivate Plugins Per Page - Improve WordPress Performance

You need something different? Send me an email: nikolay@nikolaydev.com

Changelog

1.17.0 – 3 January 2025

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to add an additional URL parameter to links to editing a post. The parameter holds the post type. This helps to target back-end edit post pages with rules based on post type.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: A message showing the number of deactivated plugins by rules on the current page in the debug box.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Better compatibility with WP-Optimize. WP-Optimize is detecting the database table of this plugin as belonging to another free plugin that has copied code and the table name from this plugin. Now we hide this detection so users don’t delete the table by mistake.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: Incorrect form validation and error message on adding a rule in some situations after switching to custom URI type, choosing regex condition, and switching back to page URI type.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: The admin menu cache time setting was not set correctly in the recreate cache script.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.16.0 – 19 June 2023

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: Regular expressions can now be used as a custom URI condition. This allows for more advanced URI targeting that was impossible in previous versions. For example now it is possible to make a rule that only affects URIs that contain multiple separate keywords at the same time.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to ignore only chosen URI parameters for page rules, for better compatibility with plugins that add URI parameters to pages. This is now the default setting.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to change the admin menu cache expiration time (only used if back-end deactivation is enabled along with admin menu cache).

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Moved some settings in a separate section called Advanced Settings. For most users they will not need to be changed.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Set some of the plugin settings to not be auto-loaded in the memory by WordPress, to slightly reduce server memory usage.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Added the “v” parameter to be a chosen URI parameter by default so it is ignored by the rules. This parameter is added by WooCommerce if geolocation is enabled, and we don’t want the rules to consider it a different page when it changes.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: Incorrect admin menu links in certain cases when the cache is enabled and a conflicting plugin is back-end deactivated.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: We show an error when invalid custom condition value is entered, instead of just removing the invalid characters.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: Added higher priority styling rules for the title of the debug box in order to avoid styling bugs caused by some theme styles.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language and documentation files.

1.15.0 – 2 January 2023

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: The ability to add a custom PHP function as an additional condition for a rule.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to choose if the deactivation rules affect the front-end visual editor pages of some popular visual editor plugins.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Some hints are explaning the features in more details.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: Some spelling mistakes.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.14.3 – 14 April 2022

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: The settings were not showing correct values in Firefox after importing new values due to Firefox trying to autocomplete the old values after page reload.

1.14.2 – 9 April 2022

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: Assets not loading and incorrect paths when used in WAMP on Windows, due to incorrect directory separator. The PHP constant DIRECTORY_SEPARATOR has been removed now from the plugin.

1.14.1 – 16 January 2022

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to choose the priority of the hook we use to change the active_plugins option. In some cases changing this value will solve a conflict with another plugin (but may also cause a conflict with a different plugin).

Deactivate Plugins Per Page - Improve WordPress PerformanceREMOVED: The fix of the conflict with BuddyBoss plugin in combination with MemberPress Plus and MemberPress + BuddyPress Integration is removed by default. To enable it change the new option called “Priority” to 0.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.14.0 – 15 January 2022

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: A new rule action that allows you to copy and paste rules from one plugin or group to another.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to hide plugins with no rules if they are in at least one group.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: If there were skipped page rules when importing, the page IDs were not listed after the import.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: If an ajax request failed to be made due to a server error, it would show loading forever. Now shows an error.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: The plugin no longer works inside the visual editor screen of Elementor, Divi, and WPBakery Page Builder.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: A conflict with the BuddyBoss plugin in combination with MemberPress Plus and MemberPress + BuddyPress Integration.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: A conflict with Tutor LMS Pro in combination with the GeoDirectory plugin.

Deactivate Plugins Per Page - Improve WordPress PerformanceREMOVED: Support for custom REST-API address when trying to skip affecting it by our rules, was removed due to plugin conflicts.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language and documentation files.

1.13.3 – 30 November 2021

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: Conflict with plugins that use the REST API when a rule that deactivates on all except selected URIs is present.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: In some cases this error would occur: PHP Fatal error: Uncaught Error: Call to undefined function is_plugin_active().

1.13.2 – 7 September 21

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Compatibility with the Nitro Pack service. This version adds the “ignorenitro” URI parameter to our option with chosen URI parameters to be ignored by rules with custom URI selection. This way when the Nitro Pack bot visits your site to generate its cache, our deactivation rules will be applied correctly.

1.13.1 – 13 August 2021

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: Could not create rules on version 1.13.0 unless you had installed a previous plugin version before updating to 1.13.0.

1.13.0 – 20 July 2021

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to add a note to each rule, so you are reminded what it is for.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Added the new Update URI plugin header, so if a free plugin with the same name as this one is created in the WordPress repository, it doesn’t update and replace this one.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: The debug box in the customizer admin page now loads in the correct frame, and shows correct data.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: On some servers you would get a false error about an unexpected response after performing an action.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: If the icon of some plugin had changed, it would not load the new image. Now it detects it and gets the new one.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: The plugin no longer works inside the frame of the legacy widget blocks in WordPress 5.8.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: The plugin no longer works inside the front-end frame of the customizer.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.12.0 – 2 January 2021

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to show plugins that have rules before all other plugins in the Active / Inactive Plugins sections.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: Links to select all and deselect all pages when adding or editing rule, and the same for plugins when adding or editing a group. Also a counter for the number of currently selected.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to enable Local Mode. In local mode all deactivations affect only your device, which is detected by a cookie.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Some buttons now have a text description as well (instead of just an icon), so it is more clear what they do.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: The calculated list of active plugins after applying the deactivations is now cached in a global variable for the rest of the request to improve performance.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: A conflict with some plugins that change the active_plugins option would cause some plugins to be deactivated globally.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: When editing a rule, if there were pages that are not currently published but are selected, the background green selection color would not be there.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: If there was only one other plugin active, in the Active Plugins section it would show a message that there are no other plugins active.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.11.0 – 27 July 2020

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to show the plugin icon image next to its name in the Active Plugins and Inactive Plugins sections.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to cache the admin menus of plugins deactivated on some back-end pages.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: In a WordPress Multisite you can import the plugin rules and settings into multiple sites at once.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to enable the plugin debug mode only on the front-end or only on the back-end.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: New layout for the Settings section.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Compatibility with plugins that change the back-end dashboard address from wp-admin to something else.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: The iPad device with a Firefox browser was not detected as a mobile device.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.10.0 – 30 January 2020

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: In debug mode you can now perform quick plugin actions for the current URI: deactivate on the current URI, deactivate on all except the current URI, add a plugin to an existing group.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: A button in the top right of the debug box that reloads the page.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: A notice about caching plugins is shown when changing the affected devices menu in the add/edit rule box.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: When importing the rules and settings, an error about invalid import data sent was shown, if one of the plugins has a name starting with an empty space.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: When WP CLI is used, a warning was generated: Warning: in_array() expects parameter 2 to be array, null given…

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.9.0 – 13 November 2019

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: Global actions to export or import all rules, groups, and settings of “Deactivate Plugins Per Page”.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: The width of some drop-down boxes in WordPress 5.3.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.8.0 – 15 October 2019

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: Five plugin (or group) actions: Front-end Deactivate, Back-end Deactivate, Start Plugin Rules, Pause Plugin Rules, Delete Plugin Rules.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: A text field to find pages when adding or editing a rule.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Inactive plugins are now shown in red, when adding or editing groups.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Removed this plugin from the active plugins section.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Changed the icon for deleting a group, so it is different from the one for deleting rules.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Better responsive design for some elements on the admin page.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: If enabled, the debug box is now visible on the back-end regardless of the setting for custom URI selection rules affecting the back-end.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language and documentation files.

1.7.0 – 7 September 2019

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to ignore URI parameters when applying rules with custom URI selection. Popular tracking parameters like fbclid, fb_source, gclid, utm_medium, utm_source, and others are ignored by default.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: The sections in the admin page are now collapsible. You can show and hide them. The sections are: active plugins, inactive plugins, plugin groups, settings.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An icon that indicates which plugins are already part of at least one plugin group, when creating or editing a group.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: On the plugin admin page, the back-end notices from other plugins were shown further down on the page (instead of at the top).

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: A few spelling mistakes.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.6.0 – 9 August 2019

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to ignore all URI parameters (aka the query string) in the current page URI, when applying the deactivation rules with Page URI selection. This way when some tracking parameters are added to the URI (like for example ?utm_source=facebook&utm_medium=post) the page will still be recognised correctly by the plugin. Does not affect plain permalink structure. This will be enabled by default.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: In the 1.5.0 version, if debug mode was enabled and if we could not copy automatically the must-use plugin file to its folder, there was a PHP fatal error.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.5.0 – 5 August 2019

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to also affect the back-end dashboard area by all rules with Custom URI selection.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to control the trailing slash of Page URIs used inside the deactivation rules.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: Changed some words in the admin area to be more clear.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.4.1 – 9 July 2019

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: When editing a plugin group and some of the plugins are currently not installed, even though they show as selected (green and with a checked checkbox), they are not actually selected.

1.4.0 – 8 July 2019

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: The action to edit a rule.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: The action to edit a plugin group.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language and documentation files.

1.3.0 – 25 June 2019

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: The ability to add multiple custom conditions in one rule. This makes it possible for example to deactivate a plugin on all URI except if: the URI contains something, or if it ends with something, or some other condition, etc.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: Links to filter pages by WPML language and also the ability to select pages from multiple languages in the Add New Rule box (if WPML is active).

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option in the Add New Rule box to automatically select all translated pages with WPML of selected pages (if WPML is active).

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to show the Plugin Groups section before the Active Plugins.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: The URI values of pages are now updated when the permalink structure is re-saved, even if there are no actual changes to it. This is helpful when some plugin changes the URIs and says to re-save the permalinks. Then we will also catch the URI change made by that plugin.

Deactivate Plugins Per Page - Improve WordPress PerformanceIMPROVED: In the rules tables, the URI conditions and URI values are in one column now, with URI values in bold.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: Extracts incorrect URI of a page translated with WPML.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: Adding the same rule for the same plugin, but with pages selected in a different order, is no longer possible.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: A PHP warning about array_key_exists() expects parameter 2 to be array, bool given.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language and documentation files.

1.2.0 – 4 June 2019

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: A way to quickly find a plugin by typing a part of its name in a text field. The other plugins are filtered out temporarily.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: Global actions: pause all rules, start all rules, and delete all rules.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: The ability to create plugin groups. Group two or more plugins in order to add deactivation rules that affect them all.

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: An option to remove all the data of this plugin upon its deletion (not for multisite).

Deactivate Plugins Per Page - Improve WordPress PerformanceADDED: A warning in the plugin admin page if the version of the must-use plugin file does not match the version of the normal plugin.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: One confirmation message and also the URI condition in the rules tables were not translatable.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: The language files will be loaded even if they are only present in the “languages” folder inside the plugin folder and not present in the “wp-content/languages” folder.

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: A small conflict with the Autoptimize plugin that caused an arrow in the debug box to be visible when it should be hidden.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language and documentation files.

1.1.0 – 14 May 2019

Deactivate Plugins Per Page - Improve WordPress PerformanceFIXED: When selecting multiple pages for a rule that deactivates on all except selected, it would deactivate everywhere instead.

Deactivate Plugins Per Page - Improve WordPress PerformanceUPDATED: Language files.

1.0.0 – 13 May 2019

Initial release

5 average based on 24 ratings.

nikolaydev

nikolaydev

Visit Author's Portfolio

View Portfolio