With “Deactivate Plugins Per Page”, you can easily disable plugins on specific WordPress pages (or on all pages except a selected one).
This is beneficial for improving the speed of your site since many front-end plugins load their JavaScript and CSS assets on every page, even if they are only used on one page.
How it works?
You can set deactivation rules for active plugins. For example, for a contact form plugin that is only used on the contact page, you can create a rule to deactivate it on all URIs except the contact page.
Deactivation Rules Options
- Deactivation Type
- Deactivate on selected URI
- Deactivate on all URI except selected
- URI selection type
- Page
- Custom
- [Page] Select pages to extract URI from (it updates automatically if the page slug changes)
- [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 …
- Affected devices
- All
- Desktop
- Mobile
Plugin Groups
Create groups of multiple plugins to apply deactivation rules to them all.
Debug Mode
Enable debug mode to see the URI and which plugins are active/inactive on the current page on the front-end. This helps in creating and testing rules. A debug box will appear on the front-end if you are an administrator.
Does it affect the Back-end?
There is an option (not enabled by default) to make all rules with Custom URI selection also affect the back-end. However, some back-end pages will not be affected to avoid issues, such as pages controlling plugin activation, deactivation, updates, and installation.
Export/Import Rules and Settings
Since version 1.9.0, you can export all your deactivation rules and plugin settings and import them on another site. Rules with Page URI selection type will be skipped if the same pages (both 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 to use it as an additional condition. The rule will only work if your function returns true. The function must be loaded in a must-use plugin so it is available before regular plugins load.
Precautions
- Group plugins that work together
If a plugin requires another to be active in order to function properly, group these plugins together and apply deactivation rules to the group. Deactivating just one may cause errors or affect the other plugin.
- Don’t deactivate plugins required by your theme
Some themes rely on specific plugins to function correctly. Deactivating these plugins can cause issues.
- Deactivation hooks will not run
When plugins are deactivated using this plugin, the deactivation function won’t be triggered, meaning deactivation hooks won’t run. Instead, plugins are dynamically removed from the active list before the page loads. Therefore, any actions related to deactivation, such as removing code from the “.htaccess” file, won’t occur.
- Don’t use this plugin to hide sensitive data
This plugin is not intended for secure purposes such as hiding sensitive data. It is primarily designed for site speed optimization, debugging, or resolving plugin compatibility issues.
- Backup your site
Deactivating plugins per page is not standard for WordPress, and some plugins or themes might not expect this behavior. While it works well in most cases, it can sometimes cause issues, such as deactivating other plugins or changing settings. Always back up your site and, if possible, test changes in a staging environment.
There are no reviews yet.