Besides installing WordPress, we usually install several plugins. But after a while, you need to get rid of some of them. They may be outdated, reduce the website’s performance or any other reason.
In this article, we talk about how you can uninstall a WordPress plugin.
Why You Need to Uninstall a WordPress Plugin?
There are many plugins available to download with one click in WordPress. But, if you are not using a plugin, it’s best to uninstall it from your dashboard.
Plugins work as software installed on your website. Although plugin developers always try to optimize their product, there always may be errors that could affect your website’s performance.
On the other hand, unused plugins take up space on your server and when you want to backup your website, it may take a longer time.
Difference Between Deactivating and Uninstalling a WordPress Plugin
WordPress users often deactivate a plugin when they face errors on their WordPress website.
This is the simplest way to fix an error caused by a plugin. Because your plugin’s configuration is saved in your plugin’s settings and you can always activate it with the same settings.
But the error may be caused by something else on your website and you may not need to activate the plugin again.
The deactivated plugin may seem safe and secure, but keep in mind, its codes are still on your website. This situation gets worse if you are not using any firewall to protect your website from PHP.
Deactivated plugins that are still supported by WordPress will send you notifications every time there is a new update. However, this isn’t the case for premium plugins and you won’t be notified if there is an update for your plugin.
Thus, if you don’t have any needs for a plugin, it’s best to uninstall it rather than deactivating it. By doing so, you empty your database of unnecessary data.
How to Uninstall a WordPress Plugin Properly?
You can simply deactivate and uninstall a plugin from the dashboard. But there are files and lines of code left that also need to be removed. Here is how to uninstall a WordPress plugin in the right way.
1. Uninstall a WordPress Plugin from the Dashboard
To do so, head over to your WordPress dashboard, go to plugins and delete the desired plugin.
Activated plugins are highlighted by blue color and you can see deactivate underneath them.
Underneath already deactivated plugins in your dashboard, you can see activate, edit and delete. Simply click on delete and “yes, delete these files” to delete the plugin.
For beginners, this is all you need to know. However, there are other steps to take to completely delete the plugin on your server. Plugins, cache, SEO and security plugins usually leave a trace behind.
2. Remove Extra Files Added by a WordPress Plugin
In most cases, by deleting a plugin, all the related files to that plugin are also deleted. But there are some plugins that store files outside of the plugins folder. Those files won’t be deleted after you delete the plugin.
To find and delete these files you need to use an FTP client. Connect to your server with FTP and head over to wp/content folder.
Backup, gallery and slider plugins usually save their files in this folder. If you don’t have a backup of your website, make sure you get a backup of this folder. Then, proceed to delete the saved plugin files from your server.
3. Remove Unused Shortcodes in WordPress
There are many plugins that use shortcodes to add some details to your pages and posts.
When you delete those plugins, their shortcodes still remain on your website and they have a bad appearance without their plugins.
To delete these shortcodes, copy and paste the code below to your functions.php file. Keep in mind, replace “pluginshortcode” with the shortcodes name/tag.
In the future, if you wanted to reuse the plugin, simply remove the code above from your functions.php file.
4. Clean Up WordPress Database from Plugin Tables
Some WordPress plugins create tables in your database. These tables contain a lot of information, which can add up to the size of your backup and slow your website down.
To delete them, you can use a special plugin or manually delete them in phpMyAdmin. Be careful not to accidentally delete any crucial tables and make sure you get a backup from your database before making any changes.
The best option to delete unnecessary tables in your database is Advanced Database Cleaner plugin. This is a premium plugin and it scans your database and locates unused and unnecessary tables left behind by your plugins and deletes them.
If you want to manually do this process yourself and if your hosting provider has given you access to cPanel, do the steps below.
- Go to your cPanel
- From the database section click on phpMyAdmin
- Find your website’s database and check the unnecessary tables.
- At the bottom of the page, you can see “with selected”.
- Change its status to Drop.
- A message pops up. click yes to delete your unnecessary tables.
Keep in mind, you cannot undo this process unless you have a backup of your database.
Uninstall Popular WordPress Plugins
Each plugin leaves certain traces behind. Here are some of the most well-known plugins and how to completely delete them.
How to uninstall WooCommerce Plugins
WooCommerce creates 16 tables in your database. Before deleting the plugin, you need to copy and paste the code below to your wp-config.php file, so when you delete the plugin, its database tables are also deleted:
// Remove all data from WooCommerce on uninstall define(‘WC_REMOVE_ALL_DATA’, true);
Most plugins, leave tables in wp_options. By using the query below, you can delete those tables as well:
select * from wp_options where option_name like “% wc%”;
Once you see a few columns, run the query below:
delete from wp_options where option_name like “% wc%”;
How to uninstall Yoast SEO Plugin
This plugin leaves two tables behind. To delete them in the wp_postmeta table, run the query below in the table:
select * from wp_postmeta where meta_key like “%yoast%”;
Once you see a few columns, run the query below:
delete from wp_postmeta where meta_key like “%yoast%”;
Also, in the wp_usermeta table, run the queries below:
select * from wp_usermeta where meta_key like “%yoast%”;
delete from wp_usermeta where meta_key like “%yoast%”;
As mentioned above, most plugins leave some data in the wp_options table. By running the queries below, you can delete them. Make sure you replace “pluginname” with your plugin’s name, in this case, yoast:
Select * from wp_options where option_name like “%pluginname%”;
Delete from wp_options where option_name like “%pluginname%”;
Head over to your phpMyAdmin and search for wpseo, click or select all the appeared and related tables to YoastSEO plugin and click on “Go” to delete them.
YoastSEO also creates a cron job known as wpseo_onpage_fetch. To delete cron jobs you need to install WP Control plugin.
How to Uninstall Akismet Plugin
Akismet is the most popular way to stop spam comments in WordPress. After deleting Akismet from your WordPress dashboard, many related data still remain in the wp_commentmeta table. You need to manually delete them. Run the query below in the wp_commentmeta table:
select * from wp_commentmeta where meta_key like “%akismet_%”;
After running the query above, a few columns may appear. Once they do, run the query below:
delete from wp_commentmeta where meta_key like “%akismet_%”;
By running these queries, you delete the unnecessary data in your wp_commentmeta table.
How to uninstall Gravity Forms Plugin
Go to your dashboard. From plugins, find Gravity Forms plugin. This plugin creates 9 tables in your database. Go to forms, settings and uninstall. Click on uninstall and hit OK. Go to plugin’s page to completely delete it.
Now you need to delete the saved files from your wp_options. Use the query below and replace pluginname with the plugin’s name:
select * from wp_options where option_name like “%pluginname%”;
Then run this query:
delete from wp_options where option_name like “%pluginname%”;
How to uninstall Wordfence Plugin
This popular plugin creates 23 tables in your database.
To delete Wordfence, you need to install Wordfence Assistant plugin. Then, deactivate Wordfence plugin and delete it. Then, go to Wordfence assistant plugin and check “delete all wordfence data and tables”.
How to Uninstall NextGEN Gallery Plugin
This plugin creates 3 tables in your database. Also, it creates an ‘ngg’ folder in wp-content. You need to manually remove the folder and tables.
Run the query below in wp_options table:
Select * from wp_options where option_name like “%ngg%”;
Delete from wp_options where option_name like “%ngg%”;
How to uninstall EWWW Image Optimizer Plugin
This plugin saves data about the path of your image, original sizes, and their size after compression in wp_ewwio_images table. Also, it creates ewww folder, which you need to manually delete via an FTP client.
Run the query below in wp_options table:
Select * from wp_options where option_name like “%ewwwio%”;
Delete * from wp_options where option_name like “%ewwwio%”;
How to Uninstall WP All Export Plugin
After deleting the plugin from your WordPress dashboard, you need to manually delete the 4 remaining tables from your database (In the WordPress database optimization, we have discussed how you can delete these tables).
Properly uninstalling a WordPress plugin can take time, depending on their developers.
To properly and completely delete a WordPress plugin you need to take a series of steps. After deleting a plugin in your WordPress dashboard, they usually leave behind a few tables in your database.
As a user, never install plugins on your website just to test them. This is a risky way.
Also, once you install a new plugin you need to know how you can properly delete it from your WordPress website.
Keep in mind, big plugins will create and save big data in your database. Therefore, it is recommended to delete unnecessary files and tables from your website and database to reduce the backup size and optimize your database.