
Deactivate Plugins Per Page – Improve WordPress Performance
Tested with WordPress 6.6 on 21.07.2024
Short Description
With “Deactivate Plugins Per Page” you may simply disable plugins on sure WordPress pages (or on all besides a specific web page).
This is beneficial for dashing up your web site primarily as a result of many entrance-finish plugins will load their JavaScript and CSS property on each web page, even if you happen to use them on one web page.
How it really works?
You can add deactivation guidelines for energetic plugins. For instance for a contact type plugin, that you simply solely use on the contact web page, merely add a rule to deactivate it on all URI besides on the contact web page.
Deactivation Rules Options
1. Deactivation Type
– Deactivate on chosen URI
– Deactivate on all URI besides chosen
2. URI choice sort
– Page
– Custom
3. [Page] Select pages to extract URI from (it can replace robotically if the web page slug adjustments)
3. [Custom] Custom URI situation
– URI equals …
– URI doesn’t equal …
– URI incorporates …
– URI doesn’t comprise …
– URI begins with …
– URI doesn’t begin with …
– URI ends with …
– URI doesn’t finish with …
– URI matches the common expression …
4. Affected gadgets
– All
– Desktop
– Mobile
Plugin Groups
Create teams of a number of plugins to be able to add deactivation guidelines that have an effect on all of them.
Debug Mode
Enable debug mode to see what’s the URI and which plugins are energetic/inactive on the present web page on the entrance-finish. This will make it easier to create guidelines and take a look at present ones. A debug field will seem on the entrance-finish if you’re an administrator consumer.
Does it have an effect on the Back-end?
There is an possibility (not enabled by default) that makes all guidelines with Custom URI choice to additionally have an effect on the again-finish. Some again-finish pages will nonetheless not be affected to be able to keep away from issues, just like the pages that management plugin activation, deactivation, updates, and set up.
Export/Import Rules and Settings
Since model 1.9.0 you may export all of your deactivation guidelines and settings of the plugin and import them on one other web site. Rules with Page URI choice sort, might be skipped if the identical pages (each similar ID and slug) don’t exist on the vacation spot web site. In a multisite you may import into a number of websites directly.
Custom PHP operate as situation
Since model 1.15.0 you may add the identify of your personal PHP operate to a deactivation rule so it’s used as an extra situation. The rule will solely work in case your operate additionally returns true. The operate have to be loaded in a must use plugin so it’s out there earlier than common plugins load.
Client Reviews
Precautions
Group plugins that work collectively
If you might have a plugin that requires one other plugin to be energetic to be able to work, it is advisable to add these plugins in a plugin group, and add deactivation guidelines to that group. Deactivating solely one in all these might result in errors or the worldwide deactivation of the opposite plugin.
Don’t deactivate plugins required by your theme
Some themes require sure plugins to be able to work correctly. If you deactivate these plugins chances are you’ll expertise issues.
Deactivation hooks won’t run
When plugins are deactivated by way of my plugin, the precise deactivation operate is just not known as, and the deactivation hooks won’t run. Instead, to make it work per web page, plugins are simply dynamically faraway from the listing of energetic plugins earlier than the web page masses. This signifies that if a plugin has some actions that it performs when it’s deactivated, these actions won’t run when it’s deactivated by way of my plugin.
For instance, some plugins add code to your ”.htaccess” file when they’re activated, and when they’re deactivated, they take away it. In this case if you happen to add a deactivation rule with my plugin to cease the plugin on a sure web page, the ”.htaccess” code will nonetheless be there and work on that web page, though the plugin won’t be energetic on it.
Don’t use this plugin to cover delicate knowledge
It is just not made to work securely for that. It is especially made for web site velocity optimization and it may also be used for debugging or fixing plugin compatibility points.
Backup your web site
Deactivating plugins per web page is just not a pure factor for WordPress, and plugin and theme builders are usually not anticipating that. It works nice normally, however generally can result in issues, to different plugins being deactivated or settings being modified. Always have a latest backup of your web site and if you happen to can, take a look at your adjustments in a staging web site.
Feedback / Support / Questions
Use the support section (requires signal-in), or my electronic mail nikolay@nikolaydev.com
Tested Up To
WordPress 6.6
PHP 8.2.6
Hire me to make a customized plugin for you
You want one thing completely different? Send me an electronic mail: nikolay@nikolaydev.com
Changelog
1.16.0 – 19 June 2023
ADDED: Regular expressions can now be used as a customized URI situation. This permits for extra superior URI focusing on that was not possible in earlier variations. For instance now it’s doable to make a rule that solely impacts URIs that comprise a number of separate key phrases on the similar time.
ADDED: An choice to ignore solely chosen URI parameters for web page guidelines, for higher compatibility with plugins that add URI parameters to pages. This is now the default setting.
ADDED: An possibility to alter the admin menu cache expiration time (solely used if again-finish deactivation is enabled together with admin menu cache).
IMPROVED: Moved some settings in a separate part known as Advanced Settings. For most customers they won’t must be modified.
IMPROVED: Set among the plugin settings to not be auto-loaded within the reminiscence by WordPress, to barely scale back server reminiscence utilization.
IMPROVED: Added the “v” parameter to be a selected URI parameter by default so it’s ignored by the foundations. This parameter is added by WooCommerce if geolocation is enabled, and we don’t need the foundations to contemplate it a unique web page when it adjustments.
FIXED: Incorrect admin menu hyperlinks in sure circumstances when the cache is enabled and a conflicting plugin is again-finish deactivated.
FIXED: We present an error when invalid customized situation worth is entered, as a substitute of simply eradicating the invalid characters.
FIXED: Added increased precedence styling guidelines for the title of the debug field to be able to keep away from styling bugs attributable to some theme kinds.
UPDATED: Language and documentation recordsdata.
1.15.0 – 2 January 2023
ADDED: The capacity so as to add a customized PHP operate as an extra situation for a rule.
ADDED: An possibility to decide on if the deactivation guidelines have an effect on the entrance-finish visible editor pages of some fashionable visible editor plugins.
IMPROVED: Some hints are explaning the options in additional particulars.
FIXED: Some spelling errors.
UPDATED: Language recordsdata.
1.14.3 – 14 April 2022
FIXED: The settings weren’t exhibiting appropriate values in Firefox after importing new values as a consequence of Firefox attempting to autocomplete the previous values after web page reload.
1.14.2 – 9 April 2022
FIXED: Assets not loading and incorrect paths when utilized in WAMP on Windows, as a consequence of incorrect listing separator. The PHP fixed DIRECTORY_SEPARATOR has been eliminated now from the plugin.
1.14.1 – 16 January 2022
ADDED: An possibility to decide on the precedence of the hook we use to alter the active_plugins possibility. In some circumstances altering this worth will remedy a battle with one other plugin (however may trigger a battle with a unique plugin).
REMOVED: The repair of the battle with BuddyBoss plugin together with MemberPress Plus and MemberPress + BuddyPress Integration is eliminated by default. To allow it change the brand new possibility known as “Priority” to 0.
UPDATED: Language recordsdata.
1.14.0 – 15 January 2022
ADDED: A brand new rule motion that lets you copy and paste guidelines from one plugin or group to a different.
ADDED: An possibility to cover plugins with no guidelines if they’re in not less than one group.
FIXED: If there have been skipped web page guidelines when importing, the web page IDs weren’t listed after the import.
FIXED: If an ajax request did not be made as a consequence of a server error, it will present loading endlessly. Now exhibits an error.
FIXED: The plugin not works contained in the visible editor display of Elementor, Divi, and WPBakery Page Builder.
FIXED: A battle with the BuddyBoss plugin together with MemberPress Plus and MemberPress + BuddyPress Integration.
FIXED: A battle with Tutor LMS Pro together with the GeoDirectory plugin.
REMOVED: Support for customized REST-API deal with when attempting to skip affecting it by our guidelines, was eliminated as a consequence of plugin conflicts.
UPDATED: Language and documentation recordsdata.
1.13.3 – 30 November 2021
FIXED: Conflict with plugins that use the REST API when a rule that deactivates on all besides chosen URIs is current.
FIXED: In some circumstances this error would happen: PHP Fatal error: Uncaught Error: Call to undefined operate is_plugin_active().
1.13.2 – 7 September 21
IMPROVED: Compatibility with the Nitro Pack service. This model provides the “ignorenitro” URI parameter to our possibility with chosen URI parameters to be ignored by guidelines with customized URI choice. This manner when the Nitro Pack bot visits your web site to generate its cache, our deactivation guidelines might be utilized appropriately.
1.13.1 – 13 August 2021
FIXED: Could not create guidelines on model 1.13.0 until you had put in a earlier plugin model earlier than updating to 1.13.0.
1.13.0 – 20 July 2021
ADDED: An possibility so as to add a observe to every rule, so you might be reminded what it’s for.
IMPROVED: Added the brand new Update URI plugin header, so if a free plugin with the identical identify as this one is created within the WordPress repository, it doesn’t replace and change this one.
FIXED: The debug field within the customizer admin web page now masses within the appropriate body, and exhibits appropriate knowledge.
FIXED: On some servers you’ll get a false error about an surprising response after performing an motion.
FIXED: If the icon of some plugin had modified, it will not load the brand new picture. Now it detects it and will get the brand new one.
FIXED: The plugin not works contained in the body of the legacy widget blocks in WordPress 5.8.
FIXED: The plugin not works contained in the entrance-finish body of the customizer.
UPDATED: Language recordsdata.
1.12.0 – 2 January 2021
ADDED: An possibility to point out plugins which have guidelines earlier than all different plugins within the Active / Inactive Plugins sections.
ADDED: Links to pick all and deselect all pages when including or enhancing rule, and the identical for plugins when including or enhancing a gaggle. Also a counter for the variety of presently chosen.
ADDED: An choice to allow Local Mode. In native mode all deactivations have an effect on solely your system, which is detected by a cookie.
IMPROVED: Some buttons now have a textual content description as nicely (as a substitute of simply an icon), so it’s extra clear what they do.
IMPROVED: The calculated listing of energetic plugins after making use of the deactivations is now cached in a world variable for the remainder of the request to enhance efficiency.
FIXED: A battle with some plugins that change the active_plugins possibility would trigger some plugins to be deactivated globally.
FIXED: When enhancing a rule, if there have been pages that aren’t presently printed however are chosen, the background inexperienced choice colour wouldn’t be there.
FIXED: If there was just one different plugin energetic, within the Active Plugins part it will present a message that there are not any different plugins energetic.
UPDATED: Language recordsdata.
1.11.0 – 27 July 2020
ADDED: An possibility to point out the plugin icon picture subsequent to its identify within the Active Plugins and Inactive Plugins sections.
ADDED: An choice to cache the admin menus of plugins deactivated on some again-finish pages.
ADDED: In a WordPress Multisite you may import the plugin guidelines and settings into a number of websites directly.
ADDED: An choice to allow the plugin debug mode solely on the entrance-finish or solely on the again-finish.
IMPROVED: New structure for the Settings part.
IMPROVED: Compatibility with plugins that change the again-finish dashboard deal with from wp-admin to one thing else.
FIXED: The iPad system with a Firefox browser was not detected as a cellular system.
UPDATED: Language recordsdata.
1.10.0 – 30 January 2020
ADDED: In debug mode now you can carry out fast plugin actions for the present URI: deactivate on the present URI, deactivate on all besides the present URI, add a plugin to an present group.
ADDED: A button within the high proper of the debug field that reloads the web page.
IMPROVED: A discover about caching plugins is proven when altering the affected gadgets menu within the add/edit rule field.
FIXED: When importing the foundations and settings, an error about invalid import knowledge despatched was proven, if one of many plugins has a reputation beginning with an empty house.
FIXED: When WP CLI is used, a warning was generated: Warning: in_array() expects parameter 2 to be array, null given…
UPDATED: Language recordsdata.
1.9.0 – 13 November 2019
ADDED: Global actions to export or import all guidelines, teams, and settings of “Deactivate Plugins Per Page”.
FIXED: The width of some drop-down packing containers in WordPress 5.3.
UPDATED: Language recordsdata.
1.8.0 – 15 October 2019
ADDED: Five plugin (or group) actions: Front-end Deactivate, Back-end Deactivate, Start Plugin Rules, Pause Plugin Rules, Delete Plugin Rules.
ADDED: A textual content discipline to search out pages when including or enhancing a rule.
IMPROVED: Inactive plugins are actually proven in purple, when including or enhancing teams.
IMPROVED: Removed this plugin from the energetic plugins part.
IMPROVED: Changed the icon for deleting a gaggle, so it’s completely different from the one for deleting guidelines.
IMPROVED: Better responsive design for some components on the admin web page.
IMPROVED: If enabled, the debug field is now seen on the again-finish whatever the setting for customized URI choice guidelines affecting the again-finish.
UPDATED: Language and documentation recordsdata.
1.7.0 – 7 September 2019
ADDED: An choice to ignore URI parameters when making use of guidelines with customized URI choice. Popular monitoring parameters like fbclid, fb_source, gclid, utm_medium, utm_source, and others are ignored by default.
ADDED: The sections within the admin web page are actually collapsible. You can present and conceal them. The sections are: energetic plugins, inactive plugins, plugin teams, settings.
ADDED: An icon that signifies which plugins are already a part of not less than one plugin group, when creating or enhancing a gaggle.
FIXED: On the plugin admin web page, the again-finish notices from different plugins have been proven additional down on the web page (as a substitute of on the high).
FIXED: A couple of spelling errors.
UPDATED: Language recordsdata.
1.6.0 – 9 August 2019
ADDED: An choice to ignore all URI parameters (aka the question string) within the present web page URI, when making use of the deactivation guidelines with Page URI choice. This manner when some monitoring parameters are added to the URI (like for instance ?utm_source=fb&utm_medium=submit) the web page will nonetheless be recognised appropriately by the plugin. Does not have an effect on plain permalink construction. This might be enabled by default.
FIXED: In the 1.5.0 model, if debug mode was enabled and if we couldn’t copy robotically the should-use plugin file to its folder, there was a PHP deadly error.
UPDATED: Language recordsdata.
1.5.0 – 5 August 2019
ADDED: An choice to additionally have an effect on the again-finish dashboard space by all guidelines with Custom URI choice.
ADDED: An possibility to manage the trailing slash of Page URIs used contained in the deactivation guidelines.
IMPROVED: Changed some phrases within the admin space to be extra clear.
UPDATED: Language recordsdata.
1.4.1 – 9 July 2019
FIXED: When enhancing a plugin group and among the plugins are presently not put in, though they present as chosen (inexperienced and with a checked checkbox), they don’t seem to be truly chosen.
1.4.0 – 8 July 2019
ADDED: The motion to edit a rule.
ADDED: The motion to edit a plugin group.
UPDATED: Language and documentation recordsdata.
1.3.0 – 25 June 2019
ADDED: The capacity so as to add a number of customized circumstances in a single rule. This makes it doable for instance to deactivate a plugin on all URI besides if: the URI incorporates one thing, or if it ends with one thing, or another situation, and many others.
ADDED: Links to filter pages by WPML language and in addition the flexibility to pick pages from a number of languages within the Add New Rule field (if WPML is energetic).
ADDED: An possibility within the Add New Rule field to robotically choose all translated pages with WPML of chosen pages (if WPML is energetic).
ADDED: An possibility to point out the Plugin Groups part earlier than the Active Plugins.
IMPROVED: The URI values of pages are actually up to date when the permalink construction is re-saved, even when there are not any precise adjustments to it. This is useful when some plugin adjustments the URIs and says to re-save the permalinks. Then we can even catch the URI change made by that plugin.
IMPROVED: In the foundations tables, the URI circumstances and URI values are in a single column now, with URI values in daring.
FIXED: Extracts incorrect URI of a web page translated with WPML.
FIXED: Adding the identical rule for a similar plugin, however with pages chosen in a unique order, is not doable.
FIXED: A PHP warning about array_key_exists() expects parameter 2 to be array, bool given.
UPDATED: Language and documentation recordsdata.
1.2.0 – 4 June 2019
ADDED: A method to rapidly discover a plugin by typing part of its identify in a textual content discipline. The different plugins are filtered out quickly.
ADDED: Global actions: pause all guidelines, begin all guidelines, and delete all guidelines.
ADDED: The capacity to create plugin teams. Group two or extra plugins to be able to add deactivation guidelines that have an effect on all of them.
ADDED: An choice to take away all the info of this plugin upon its deletion (not for multisite).
ADDED: A warning within the plugin admin web page if the model of the should-use plugin file doesn’t match the model of the traditional plugin.
FIXED: One affirmation message and in addition the URI situation within the guidelines tables weren’t translatable.
FIXED: The language recordsdata might be loaded even when they’re solely current within the “languages” folder contained in the plugin folder and never current within the “wp-content material/languages” folder.
FIXED: A small battle with the Autoptimize plugin that triggered an arrow within the debug field to be seen when it must be hidden.
UPDATED: Language and documentation recordsdata.
1.1.0 – 14 May 2019
FIXED: When deciding on a number of pages for a rule that deactivates on all besides chosen, it will deactivate in all places as a substitute.
UPDATED: Language recordsdata.
1.0.0 – 13 May 2019
Initial launch