September 22, 2022 | Posted in WordPress
Do you want to stop customers from mistakenly disabling WordPress plugins on their websites?
If you build websites for other people’s businesses, you probably already have a preferred toolkit of essential WordPress plugins installed on all of your customers’ websites. You can also insert client-specific code snippets into site-specific plugins for that customer.
However, customers risk inadvertently deactivating one of those plugins, which might negatively impact the functioning of their site or even entirely damage it.
To minimize your user’s power over your site, this post shows how to securely prevent them from deactivating WordPress plugins.
We will discuss two approaches, and you are free to choose the one that best suits your needs. Along the way, we’ll also discuss other ways to address the problem.
Let’s begin with the path of least resistance.
This approach is more straightforward and causes less disruption than others. In addition, it grants unlimited power to all users with the administrator position, so they may disable it anytime they choose.
To put it simply, we will use a plugin that removes the link to “Deactivate” from all other plugins. Users would still be allowed to install new plugins, but they would do so at their own risk, and they may stop this protection at any moment.
Installing and activating the Disable Plugin Deactivation plugin is the very first item on your list of things to accomplish. Check out our comprehensive walkthrough of installing a WordPress plugin for additional information and specifics.
Once the plugin has been excited, you will need to visit the Plugins » Plugin Deactivation Settings page to adjust the plugin’s settings.
To disable the ‘Deactivate’ link for all plugins, you must pick the ‘Enable’ button next to the ‘Disable Plugin Deactivation’ option.
You also have the option of disabling the activation of plugins, which would prevent users from activating any additional plugins. You also can disable the deletion of plugins and stop users from downloading and installing plugin updates.
Using this approach, you can prevent the deactivation of a single plugin or a collection of specific plugins installed on a website.
It will be necessary for you to insert code into your WordPress website. You are getting started with code snippets in WordPress if you are interested in learning more about how to do so.
To begin, you will necessity to locate the locations of any plugins that you want to deactivate. On your website, the wp-content folder is where WordPress plugins are kept.
Using an FTP program to connect to your WordPress hosting account gives you access to this folder, which you may browse. If you go within the plugins folder, you will see a separate folder for each plugin installed on that website.
You will also find a file for each plugin within each folder. These files are often titled after the plugin and have the extension.php appended to their names.
You can go to the plugins page, where you will see that the deactivate link has been removed from underneath the plugins in question.
This strategy is superior since it just modifies the most essential plugins. Your customers will still be able to update all plugins, deactivate other plugins, uninstall plugins, and install new plugins.
A built-in user role management mechanism is included with WordPress by default. The following user roles are included in the typical WordPress installation by default:
Check out our comprehensive introduction to the user roles and permissions of WordPress if you’re interested in learning more.
The permission to manage plugins is exclusive to the Administrator user position in the system. If you are developing a website for a customer, you can create two user accounts just for that client.
One with Administrator credentials will allow them to maintain the website independently without assistance. After that, you’ll have the option to create a second user account with the Editor user role. Your customers will be able to utilize it to generate content.
Because of this, the likelihood of them inadvertently deactivating essential plugins will be reduced. To successfully install updates and add new users, they must be instructed to utilize the Administrator account responsibly.
You also have the choice of building a bespoke user role for yourself, complete with its unique permissions. You will be able to make a user role that can edit themes but has no control over plugins using this method.
We hope this post helped teach you how to stop customers from deactivating plugins in WordPress. You may also be concerned about checking out our advice on how to create a personalized login page for WordPress users who are your customers.