Utilize Deactivate Plugins Per Page to selectively deactivate plugins on specific WordPress pages, or on all pages except a designated one.
This tool enhances website speed by preventing front-end plugins, often utilizing JavaScript or CSS elements, from loading on every page, even if they are only used on a single page. How does it operate? You can establish rules to deactivate active plugins. For example, if you employ a contact form plugin solely for a designated contact page, create a rule to disable it on all URIs except that contact page.
Deactivate Plugins Per Page Precautions:
- Don’t deactivate plugins required by your theme
- Some themes require certain plugins to work properly. If you deactivate these plugins you may experience problems.
- Group plugins that work together
- If you have a plugin that requires another plugin to be active to work, you need to add these plugins to 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 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.
- 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.
- 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, 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.
You are replying to :