{"id":171459,"date":"2018-03-30T13:00:47","date_gmt":"2018-03-30T13:00:47","guid":{"rendered":"https:\/\/premium.wpmudev.org\/blog\/?p=171459"},"modified":"2022-02-23T01:56:56","modified_gmt":"2022-02-23T01:56:56","slug":"how-to-fully-uninstall-a-wordpress-plugin","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/how-to-fully-uninstall-a-wordpress-plugin\/","title":{"rendered":"How to Fully Uninstall a WordPress Plugin"},"content":{"rendered":"<p>Plugins can be a great boon to WordPress sites, but there are times they outlive their usefulness.<\/p>\n<p>If a plugin fulfills a function you don\u2019t need anymore, stops being updated, or appears to slow your site down, it may be time to remove it.<\/p>\n<p>Normally to delete a plugin you would go to the Plugins section of the admin, deactivate it first, and then select the delete option. Then you\u2019re done\u2026 right?<\/p>\n<p>Unfortunately, not always.<\/p>\n<p>Uninstalling a plugin <strong>should<\/strong> be a simple task, but it is not always the case. Plugins can store data in a number of places, and unfortunately, not all developers include an uninstall script which fully removes that data.<\/p>\n<p>In this post, we&#8217;ll cover:<\/p>\n<ul>\n<li><a href=\"#what-plugins\">What plugins typically store data?<\/a><\/li>\n<li><a href=\"#where-plugins\">Where do plugins store data?<\/a><\/li>\n<li><a href=\"#new-install\">What&#8217;s in a new install of WordPress?<\/a><\/li>\n<li><a href=\"#easy-delete\">How easy is it to fully delete plugins?<\/a><\/li>\n<li><a href=\"#plugin-uninstallers\">Plugins that have uninstallers in wp-admin<\/a><\/li>\n<li><a href=\"#uninstall-scripts\">Plugins that have uninstall scripts<\/a><\/li>\n<li><a href=\"#other-methods\">Other plugin uninstall methods<\/a><\/li>\n<li><a href=\"#data-left\">Plugins that leave data behind<\/a><\/li>\n<li><a href=\"#cleanup-plugins\">How do you clean up after messy plugins?<\/a><\/li>\n<\/ul>\n<h2 id=\"what-plugins\">What plugins typically store data?<\/h2>\n<p>Plugins which ask for user input are the most likely to store data.<\/p>\n<p>They include:<\/p>\n<ul>\n<li>Form plugins<\/li>\n<li>Caching plugins<\/li>\n<li>SEO plugins<\/li>\n<li>Security plugins<\/li>\n<\/ul>\n<h2 id=\"where-plugins\">Where do plugins store data?<\/h2>\n<p>The <strong>wp_options<\/strong> database table stores information on which plugins are active, and what settings they have active.<\/p>\n<p><strong>Custom database tables<\/strong> are created by some plugins to store data.<\/p>\n<p>Plugins may modify WordPress&#8217;\u00a0<strong>wp-config.php<\/strong> file. If your site runs on Apache, the <strong>.htaccess<\/strong> file may have rules added to it. These could include security or caching settings, for example.<\/p>\n<p>Files and folders within the <strong>wp-content<\/strong> folder may be created by plugins too.<\/p>\n<p>To identify what\u2019s added by plugins, it helps to know what\u2019s in a standard WordPress install.<\/p>\n<h2 id=\"new-install\">What\u2019s in a new install of WordPress?<\/h2>\n<h3>Database tables<\/h3>\n<p>A new install of WordPress will have the following tables:<\/p>\n<ol>\n<li>wp_commentmeta<\/li>\n<li>wp_comments<\/li>\n<li>wp_links<\/li>\n<li>wp_options<\/li>\n<li>wp_postmeta<\/li>\n<li>wp_posts<\/li>\n<li>wp_termmeta<\/li>\n<li>wp_terms<\/li>\n<li>wp_term_relationships<\/li>\n<li>wp_term_taxonomy<\/li>\n<li>wp_usermeta<\/li>\n<li>wp_users<\/li>\n<\/ol>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/WordPress-standard-database-tables-600.png\" alt=\"Tables in a single vanilla WordPress install\" width=\"600\" height=\"323\" \/><figcaption class=\"wp-caption-text\">Tables in a single vanilla WordPress install.<\/figcaption><\/figure>\n<p>If you set up a multisite you\u2019ll have those 12 tables plus a few more:<\/p>\n<ol>\n<li>wp_blogs<\/li>\n<li>wp_blog_versions<\/li>\n<li>wp_registration_log<\/li>\n<li>wp_signups<\/li>\n<li>wp_site<\/li>\n<li>wp_sitemeta<\/li>\n<\/ol>\n<p>Your WordPress install might have a prefix other than wp_ if you chose another one on install, or have altered it through the use of a plugin. (For simplicity I\u2019ll continue to mention wp_ as a shorthand for your database table prefix.)<\/p>\n<p>For each new site you add to a multisite, there will be another ten tables starting with wp_2_ etc.<\/p>\n<h3>wp-content folder<\/h3>\n<p>The basic WordPress folder has an index.php file and two subfolders:<\/p>\n<ul>\n<li>plugins<\/li>\n<li>themes<\/li>\n<\/ul>\n<p>A mature install will likely have other subfolders which may include the following:<\/p>\n<ul>\n<li>languages<\/li>\n<li>mu-plugins<\/li>\n<li>upgrade<\/li>\n<li>uploads<\/li>\n<\/ul>\n<p>Any other folders present may have been created by a plugin.<\/p>\n<h2 id=\"easy-delete\">How easy is it to fully delete plugins?<\/h2>\n<p>I tested this out on a single WordPress install with some existing plugins. I tried installing and deleting a number of popular plugins to see how easy it was to uninstall them completely.<\/p>\n<p>All the plugins I tested stored information in wp_options.<\/p>\n<h2 id=\"plugin-uninstallers\">Plugins that have uninstallers in wp-admin<\/h2>\n<h3>Gravity Forms<\/h3>\n<h4>What\u2019s stored?<\/h4>\n<p>Gravity Forms creates 9 new database tables:<\/p>\n<ol>\n<li>wp_rg_form<\/li>\n<li>wp_rg_form_meta<\/li>\n<li>wp_rg_form_view<\/li>\n<li>wp_rg_incomplete_submissions<\/li>\n<li>wp_rg_lead<\/li>\n<li>wp_rg_lead_detail<\/li>\n<li>wp_rg_lead_detail_long<\/li>\n<li>wp_rg_lead_meta<\/li>\n<li>wp_rg_lead_notes<\/li>\n<\/ol>\n<h4>How should you uninstall Gravity Forms?<\/h4>\n<ol>\n<li>Go to Forms &gt; Settings &gt; Uninstall.<\/li>\n<li>Click the button.<\/li>\n<li>Choose OK.<\/li>\n<li>Go to the plugin screen to fully delete the plugin.<\/li>\n<\/ol>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/Uninstall-Gravity-Forms-600.png\" alt=\"Gravity Forms Uninstall dialog\" width=\"600\" height=\"192\" \/><figcaption class=\"wp-caption-text\">Gravity Forms Uninstall dialog.<\/figcaption><\/figure>\n<h4>Is everything deleted?<\/h4>\n<p>All 9 custom tables are deleted, but some data remains in the wp_options table.<\/p>\n<h3>Wordfence<\/h3>\n<h4>What\u2019s stored?<\/h4>\n<p>A whopping 23 database tables are created by this popular security plugin.<\/p>\n<ol>\n<li>wp_wfBadLeechers<\/li>\n<li>wp_wfBlockedCommentLog<\/li>\n<li>wp_wfBlockedIPLog<\/li>\n<li>wp_wfBlocks7<\/li>\n<li>wp_wfConfig<\/li>\n<li>wp_wfCrawlers<\/li>\n<li>wp_wfFileChanges<\/li>\n<li>wp_wfFileMods<\/li>\n<li>wp_wfHits<\/li>\n<li>wp_wfHoover<\/li>\n<li>wp_wfIssues<\/li>\n<li>wp_wfKnownFileList<\/li>\n<li>wp_wfLeechers<\/li>\n<li>wp_wfLocs<\/li>\n<li>wp_wfLogins<\/li>\n<li>wp_wfNet404s<\/li>\n<li>wp_wfNotifications<\/li>\n<li>wp_wfPendingIssues<\/li>\n<li>wp_wfReverseCache<\/li>\n<li>wp_wfScanners<\/li>\n<li>wp_wfSNIPCache<\/li>\n<li>wp_wfStatus<\/li>\n<li>wp_wfVulnScanners<\/li>\n<\/ol>\n<p>You\u2019ll also see a wflogs folder in wp-content.<\/p>\n<h4>How should you uninstall Wordfence?<\/h4>\n<p>An alternative to <a href=\"https:\/\/www.wordfence.com\/help\/advanced\/remove-or-reset\/\" target=\"_blank\">Wordfence\u2019s manual uninstall<\/a>\u00a0is adding the <a href=\"https:\/\/wordpress.org\/plugins\/wordfence-assistant\/\" target=\"_blank\">Wordfence Assistant plugin<\/a> to do the job.<\/p>\n<p>To use Wordfence Assistant, deactivate and delete Wordfence as normal. Then in Wordfence Assistant\u2019s options, choose the Delete All Wordfence Data and Tables option.<\/p>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/Wordfence-Assistant-600.png\" alt=\"Remove all Wordfence data in the database and elsewhere\" width=\"600\" height=\"212\" \/><figcaption class=\"wp-caption-text\">Remove all Wordfence data in the database and elsewhere.<\/figcaption><\/figure>\n<h4>Is everything deleted?<\/h4>\n<p>Using Wordfence Assistant, the database and files were purged of Wordfence content.<\/p>\n<h2 id=\"uninstall-scripts\">Plugins that have uninstall scripts<\/h2>\n<p>Well developed plugins have an uninstall.php file to take care of the uninstall process.<\/p>\n<p>For example:<\/p>\n<p>Broken Link Checker\u2019s uninstall script removes its 4 database tables.<\/p>\n<p><a href=\"https:\/\/github.com\/wp-plugins\/relevanssi\/blob\/master\/lib\/uninstall.php\" target=\"_blank\">Relevanssi\u2019s uninstall script<\/a> removes 3 tables created by the plugin.<\/p>\n<p><a href=\"https:\/\/docs.wp-rocket.me\/article\/694-uninstalling-wp-rocket\" target=\"_blank\">WP Rocket has an uninstall script<\/a> which is supposed to remove all data and files including the advanced-cache.php file.\u00a0 When I tried it, I noticed that this file stayed put after the plugin was gone.<\/p>\n<h2 id=\"other-methods\">Other plugin uninstall methods<\/h2>\n<p>If there is no uninstall script, some plugins have provided other suggestions for a complete uninstall.<\/p>\n<h3>NextGEN Gallery<\/h3>\n<p>This plugin creates 3 database tables:<\/p>\n<ul>\n<li>wp_ngg_album<\/li>\n<li>wp_ngg_gallery<\/li>\n<li>wp_ngg_pictures<\/li>\n<\/ul>\n<p>It also creates an ngg folder within wp-content.<\/p>\n<p>You will need to manually remove the 3 tables and the folder, as they aren\u2019t removed on uninstall. Try this advice for a <a href=\"https:\/\/wordpress.org\/support\/topic\/uninstall-43\/\" target=\"_blank\">full NextGen Gallery uninstall<\/a>.<\/p>\n<h3>WooCommerce<\/h3>\n<p>WooCommerce creates 16 tables:<\/p>\n<ol>\n<li>wp_wc_download_log<\/li>\n<li>wp_wc_webhooks<\/li>\n<li>wp_woocommerce_api_keys<\/li>\n<li>wp_woocommerce_attribute_taxonomies<\/li>\n<li>wp_woocommerce_downloadable_product_permissions<\/li>\n<li>wp_woocommerce_log<\/li>\n<li>wp_woocommerce_order_itemmeta<\/li>\n<li>wp_woocommerce_order_items<\/li>\n<li>wp_woocommerce_payment_tokenmeta<\/li>\n<li>wp_woocommerce_payment_tokens<\/li>\n<li>wp_woocommerce_sessions<\/li>\n<li>wp_woocommerce_shipping_zones<\/li>\n<li>wp_woocommerce_shipping_zone_locations<\/li>\n<li>wp_woocommerce_shipping_zone_methods<\/li>\n<li>wp_woocommerce_tax_rates<\/li>\n<li>wp_woocommerce_tax_rate_locations<\/li>\n<\/ol>\n<p><a href=\"https:\/\/docs.woocommerce.com\/document\/installing-uninstalling-woocommerce\/\" target=\"_blank\">WooCommerce recommend adding a line to wp-config.php<\/a> for a completed uninstall:<\/p>\n<div class=\"gist\" data-gist=\"36c594b27985dae375470d2ac75d56ab\" data-gist-file=\"wc-remove.php\"><a class=\"loading\" href=\"https:\/\/gist.github.com\/36c594b27985dae375470d2ac75d56ab.js?file=wc-remove.php\">Loading gist 36c594b27985dae375470d2ac75d56ab<\/a><div class=\"gist-consent-notice\" style=\"display:none\"><p>Please <a href=\"javascript:Cookiebot.renew()\">update your cookie preferences<\/a> to enable preference cookies to view this gist.<\/p><\/div><\/div>\n<p>I tried this twice and didn\u2019t get a perfect uninstall either time. Remember to double-check that the data has gone.<\/p>\n<h2 id=\"data-left\">Plugins that leave data behind<\/h2>\n<p>These are some plugins I found which don\u2019t remove all data when uninstalled.<\/p>\n<h3>Akismet<\/h3>\n<p>Akismet stores a lot of data in the wp_commentmeta table, which remains on deletion.<\/p>\n<p>Mine had nearly 6,000 rows!<\/p>\n<h3>EWWW Image Optimizer<\/h3>\n<p>This plugin stores data about the path to your images, their original size, size after compression and % reduction in the table wp_ewwwio_images. This table stayed when I removed the plugin, as did an ewww folder.<\/p>\n<h3>WP All Export<\/h3>\n<p>4 tables are created by this plugin:<\/p>\n<ul>\n<li>wp_pmxe_exports<\/li>\n<li>wp_pmxe_google_cats<\/li>\n<li>wp_pmxe_posts<\/li>\n<li>wp_pmxe_templates<\/li>\n<\/ul>\n<p>These are not removed when the plugin is deleted.<\/p>\n<h3>Yoast SEO<\/h3>\n<p>Yoast SEO creates 2 tables:<\/p>\n<ul>\n<li>wp_yoast_seo_links<\/li>\n<li>wp_yoast_seo_meta<\/li>\n<\/ul>\n<p>It also stores some data in:<\/p>\n<p>wp_usermeta &#8211; contains some meta_key values like wpseo_title.<br \/>\nwp_postmeta &#8211; contains some meta_key values for various post ids, including:<\/p>\n<ol>\n<li>_yoast_wpseo_linkdex<\/li>\n<li>_yoast_wpseo_title<\/li>\n<li>_yoast_wpseo_metadesc<\/li>\n<li>_yoast_wpseo_focuskw<\/li>\n<li>_yoast_wpseo_focuskw_text_input<\/li>\n<li>_yoast_wpseo_primary_category<\/li>\n<li>_yoast_wpseo_content_score<\/li>\n<\/ol>\n<p>A deactivate\/delete uninstall leaves all this data behind.<\/p>\n<h2 id=\"cleanup-plugins\">How do you clean up after messy plugins?<\/h2>\n<p>Firstly, <strong>back up your site<\/strong> (files and database) in case you make a mistake. Super important!<\/p>\n<p>WPMU Dev members can use<a href=\"https:\/\/wpmudev.com\/project\/snapshot\/\" target=\"_blank\"> Snapshot Pro<\/a> for backups.<\/p>\n<p>You\u2019ll be using FTP and SQL queries for the clean up. If you\u2019re not comfortable with these, <a href=\"https:\/\/wpmudev.com\/support\/\" target=\"_blank\">have an expert on hand<\/a>.<\/p>\n<h3>Delete pages<\/h3>\n<p>For any plugin that created pages, delete them if they weren\u2019t removed on uninstall and you don&#8217;t need them any more. Remember to <a href=\"https:\/\/wpmudev.com\/blog\/creating-301-redirects-wordpress\/\" target=\"_blank\">301 redirect<\/a> the page permalinks.<\/p>\n<h3>Remove unwanted database tables<\/h3>\n<p>Any tables which are not part of the usual WordPress install are likely to be tables added by plugins.<br \/>\nYou can use <strong>phpMyAdmin<\/strong>, a database manipulation tool available on most hosting control panels.<\/p>\n<p>Use the <strong>Drop<\/strong> option to delete individual tables from unwanted plugins.<\/p>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/Drop-table-600.png\" alt=\"phpMyAdmin showing tables with options including Drop\" width=\"600\" height=\"62\" \/><figcaption class=\"wp-caption-text\">phpMyAdmin showing tables with options including Drop.<\/figcaption><\/figure>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/Drop-table-confirmation-600.png\" alt=\"phpMyAdmin\u2019s warning confirmation dialog for dropping a table\" width=\"600\" height=\"381\" \/><figcaption class=\"wp-caption-text\">phpMyAdmin\u2019s warning confirmation dialog for dropping a table<\/figcaption><\/figure>\n<p>Or select multiple tables and select Drop from the <strong>With selected<\/strong> dropdown, then confirm.<\/p>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/Drop-multiple-tables-600.png\" alt=\"Dropping multiple tables with phpMyAdmin\" width=\"600\" height=\"369\" \/><figcaption class=\"wp-caption-text\">Dropping multiple tables with phpMyAdmin.<\/figcaption><\/figure>\n<div class=\"mceTemp\"><\/div>\n<p>Another option is to use the Advanced Database Cleaner plugin to inspect your tables within WordPress.<\/p>\n<p>There&#8217;s a button to detect orphaned tables, though you need to upgrade to the Pro version to use it.<\/p>\n<p>Any plugin-related tables that you&#8217;re sure you don&#8217;t need you can delete. Check them and choose Delete from the Bulk Actions dropdown.<\/p>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/Advanced-Database-Cleaner-Tables-600.png\" alt=\"Advanced Database Cleaner shows all your WordPress data tables\" width=\"581\" height=\"600\" \/><figcaption class=\"wp-caption-text\">Advanced Database Cleaner shows all your WordPress data tables.<\/figcaption><\/figure>\n<h3>Delete redundant folders from wp-content<\/h3>\n<p>FTP into your site and check the contents of files and folders you don\u2019t recognize. If you\u2019re sure you won\u2019t need them, delete them.<\/p>\n<p>For example:<\/p>\n<ul>\n<li>EWWW Image optimizer adds an ewww folder.<\/li>\n<li>NextGEN Gallery adds two folders &#8211; gallery and ngg.<\/li>\n<li>WP Rocket adds advanced-cache.php and a cache folder.<\/li>\n<\/ul>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/EWWW-folder-600.png\" alt=\"The EWWW folder within wp-content\" width=\"600\" height=\"196\" \/><figcaption class=\"wp-caption-text\">The EWWW folder within wp-content.<\/figcaption><\/figure>\n<h3>Check wp-config.php and .htaccess files<\/h3>\n<p>These are critical files, so copy them first before editing them!<\/p>\n<p>If you spot any lines in wp-config.php added by plugins you&#8217;ve deleted, remove them.<\/p>\n<p>In .htaccess look for a # followed by the plugin name and remove any lines in between.<\/p>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/htaccess-iThemes-600.png\" alt=\"Part of the code created by iThemes Security in .htaccess\" width=\"600\" height=\"262\" \/><figcaption class=\"wp-caption-text\">Part of the code created by iThemes Security in .htaccess.<\/figcaption><\/figure>\n<div class=\"mceTemp\"><\/div>\n<p>Remember to upload the updated file(s) when you are done.<\/p>\n<h3>Cleaning up transients and cron jobs<\/h3>\n<p>Transients are data stored temporarily by WordPress. Checks for WordPress updates and notices on the admin dashboard are stored in transients. Transients are (mostly) set to expire after a set time period, and are recreated over time.<\/p>\n<p>Some plugins create transients. The <a href=\"https:\/\/wordpress.org\/plugins\/transients-manager\/\" target=\"_blank\">Transients Manager<\/a> plugin will help you identify which plugins have done so, and you can delete any you no longer wish to keep.<\/p>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/Transients-Manager-600.png\" alt=\"Transients Manager shows transients and expiry date\" width=\"600\" height=\"366\" \/><figcaption class=\"wp-caption-text\">Transients Manager shows transients and expiry date.<\/figcaption><\/figure>\n<p><span style=\"font-size: 16px;\">Deleting all transients won\u2019t remove them all &#8211; the WordPress ones remain.<\/span>Cron jobs are scheduled tasks that can be run on a web server. WordPress runs its own cron jobs through WP-Cron.<\/p>\n<p><a href=\"https:\/\/wordpress.org\/plugins\/wp-crontrol\/\" target=\"_blank\">WP Crontrol<\/a> plugin will show you what cron jobs are running and when.<\/p>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/WP-Cron-Events-600.png\" alt=\"Some cron jobs revealed by WP Crontrol\" width=\"600\" height=\"364\" \/><figcaption class=\"wp-caption-text\">Some cron jobs revealed by WP Crontrol.<\/figcaption><\/figure>\n<div class=\"mceTemp\"><\/div>\n<p>You can modify or delete the cron jobs, but some core cron jobs can\u2019t be deleted.<\/p>\n<p>Unfortunately you\u2019re at the mercy of the plugin developer when it comes to naming cron jobs. If the name of a job is unclear, don\u2019t delete it, as it may affect the performance of a plugin you depend on.<\/p>\n<h3>Cleaning up your database tables<\/h3>\n<p>Now it\u2019s time to run some database queries for a final clean up.<\/p>\n<h4>Akismet<\/h4>\n<p>Did you use Akismet? This is a tidying up task you can run even if you continue to use the plugin, since Akismet generates a lot of table rows.<\/p>\n<p>On the wp_commentmeta table, run the SQL query:<\/p>\n<div class=\"gist\" data-gist=\"b0f676e666a76454a4f15641440fe865\" data-gist-file=\"select_akismet_wp_commentmeta.sql\"><a class=\"loading\" href=\"https:\/\/gist.github.com\/b0f676e666a76454a4f15641440fe865.js?file=select_akismet_wp_commentmeta.sql\">Loading gist b0f676e666a76454a4f15641440fe865<\/a><div class=\"gist-consent-notice\" style=\"display:none\"><p>Please <a href=\"javascript:Cookiebot.renew()\">update your cookie preferences<\/a> to enable preference cookies to view this gist.<\/p><\/div><\/div>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/Select-Akismet-commentmeta-600.png\" alt=\"Querying wp_commentmeta to find Akismet data\" width=\"564\" height=\"600\" \/><figcaption class=\"wp-caption-text\">Querying wp_commentmeta to find Akismet data.<\/figcaption><\/figure>\n<p><span style=\"font-size: 16px;\">(Remember to change wp_ in this query if you have a different table prefix.)<\/span>Then assuming the query found some rows, run the query<\/p>\n<div class=\"gist\" data-gist=\"d38a33587cab134d8652112a7022c7d2\" data-gist-file=\"delete_akismet_wp_commentmeta.sql\"><a class=\"loading\" href=\"https:\/\/gist.github.com\/d38a33587cab134d8652112a7022c7d2.js?file=delete_akismet_wp_commentmeta.sql\">Loading gist d38a33587cab134d8652112a7022c7d2<\/a><div class=\"gist-consent-notice\" style=\"display:none\"><p>Please <a href=\"javascript:Cookiebot.renew()\">update your cookie preferences<\/a> to enable preference cookies to view this gist.<\/p><\/div><\/div>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/Delete-Akismet-commentmeta-600.png\" alt=\"Deleting Akismet data from wp_commentmeta\" width=\"600\" height=\"110\" \/><figcaption class=\"wp-caption-text\">Deleting Akismet data from wp_commentmeta.<\/figcaption><\/figure>\n<p><span style=\"font-size: 16px;\">You should now have a much lighter wp_commentmeta table.<\/span><\/p>\n<h4>Yoast SEO<\/h4>\n<p>Yoast data seems to lurk everywhere!<\/p>\n<p>Try this SQL query on the wp_postmeta table:<\/p>\n<div class=\"gist\" data-gist=\"2cb9c8b512b36e66009360fca503b92e\" data-gist-file=\"select_yoast_wp_postmeta.sql\"><a class=\"loading\" href=\"https:\/\/gist.github.com\/2cb9c8b512b36e66009360fca503b92e.js?file=select_yoast_wp_postmeta.sql\">Loading gist 2cb9c8b512b36e66009360fca503b92e<\/a><div class=\"gist-consent-notice\" style=\"display:none\"><p>Please <a href=\"javascript:Cookiebot.renew()\">update your cookie preferences<\/a> to enable preference cookies to view this gist.<\/p><\/div><\/div>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/Yoast-postmeta-600.png\" alt=\"Yoast data in wp_postmeta\" width=\"600\" height=\"337\" \/><figcaption class=\"wp-caption-text\">Yoast data in wp_postmeta.<\/figcaption><\/figure>\n<div class=\"gist\" data-gist=\"0df61cf7ef0a954e92bb1cd817fc437d\" data-gist-file=\"delete_yoast_wp_postmeta.sql\"><a class=\"loading\" href=\"https:\/\/gist.github.com\/0df61cf7ef0a954e92bb1cd817fc437d.js?file=delete_yoast_wp_postmeta.sql\">Loading gist 0df61cf7ef0a954e92bb1cd817fc437d<\/a><div class=\"gist-consent-notice\" style=\"display:none\"><p>Please <a href=\"javascript:Cookiebot.renew()\">update your cookie preferences<\/a> to enable preference cookies to view this gist.<\/p><\/div><\/div>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-600x600\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2018\/03\/Delete-Yoast-600.png\" alt=\"558 rows of Yoast data were removed from wp_postmeta\" width=\"600\" height=\"125\" \/><figcaption class=\"wp-caption-text\">558 rows of Yoast data were removed from wp_postmeta.<\/figcaption><\/figure>\n<div class=\"mceTemp\"><\/div>\n<p>For wp_usermeta try:<\/p>\n<div class=\"gist\" data-gist=\"b202db8c3c0884a1ae41610721d2e6fd\" data-gist-file=\"query_yoast_wp_usermeta.sql\"><a class=\"loading\" href=\"https:\/\/gist.github.com\/b202db8c3c0884a1ae41610721d2e6fd.js?file=query_yoast_wp_usermeta.sql\">Loading gist b202db8c3c0884a1ae41610721d2e6fd<\/a><div class=\"gist-consent-notice\" style=\"display:none\"><p>Please <a href=\"javascript:Cookiebot.renew()\">update your cookie preferences<\/a> to enable preference cookies to view this gist.<\/p><\/div><\/div>\n<h4>wp_options table<\/h4>\n<p>Most plugins leave some entries in the wp_options table. If you want to go the whole hog in cleaning you can remove the rows related to your deleted plugins.<\/p>\n<p>Use similar queries to the previous ones to find relevant rows, and if any are found, delete them:<\/p>\n<div class=\"gist\" data-gist=\"6e54e407401e79bb0c4b51366023e69d\" data-gist-file=\"wp_options_remove_plugin_data.sql\"><a class=\"loading\" href=\"https:\/\/gist.github.com\/6e54e407401e79bb0c4b51366023e69d.js?file=wp_options_remove_plugin_data.sql\">Loading gist 6e54e407401e79bb0c4b51366023e69d<\/a><div class=\"gist-consent-notice\" style=\"display:none\"><p>Please <a href=\"javascript:Cookiebot.renew()\">update your cookie preferences<\/a> to enable preference cookies to view this gist.<\/p><\/div><\/div>\n<p>Replace the pluginname with the name or abbreviation of the plugin you\u2019re looking for (keep the % signs). Most are straightforward but a few may need some educated guesswork. Examples are:<\/p>\n<ul>\n<li>EWWW Image Optimizer: ewwwio<\/li>\n<li>NextGEN Gallery: ngg<\/li>\n<li>WooCommerce: wc<\/li>\n<\/ul>\n<p>While you\u2019re at it, you can do some more housekeeping by following these <a href=\"https:\/\/wpmudev.com\/blog\/squeaky-clean-database\/\" target=\"_blank\">10 database optimization tips<\/a>\u00a0and these <a href=\"https:\/\/wpmudev.com\/blog\/clean-up-optimize-wordpress\/\" target=\"_blank\">WordPress clean up tips<\/a>.<\/p>\n<h2>Summing up<\/h2>\n<p>Deleting plugins is not always as straightforward as it appears. A lot of information can be stored by plugins both in the filesystem and the database, and plugin developers vary on the thoroughness of their uninstall routines.<\/p>\n<p>Most of us assume an uninstall means deleting all data, and that&#8217;s not regularly the case.<\/p>\n<p>If you\u2019re a plugin developer, you might not be able to bear the thought that someone may never use your plugin again! But most users will thank you for including an uninstall script. Please follow the <a href=\"https:\/\/developer.wordpress.org\/plugins\/the-basics\/uninstall-methods\/\" target=\"_blank\">Uninstall Methods<\/a> section in the plugin development handbook.<\/p>\n<p>As a user, select your plugins carefully. Find out from developers how you uninstall them. Test out new plugins on a staging site rather than your live site to keep your site clutter-free. And remember as a general rule, the bigger the plugin, the more data it stores.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Plugins can be a great boon to WordPress sites, but there are times they outlive their usefulness. If a plugin fulfills a function you don\u2019t need anymore, stops being updated, or appears to slow your site down, it may be time to remove it. Normally to delete a plugin you would go to the Plugins [&hellip;]<\/p>\n","protected":false},"author":384374,"featured_media":171547,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[4],"tags":[10849,1004,10896],"tutorials_categories":[],"class_list":["post-171459","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-plugins","tag-plugin-update","tag-database","tag-uninstall"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/171459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/384374"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=171459"}],"version-history":[{"count":14,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/171459\/revisions"}],"predecessor-version":[{"id":209405,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/171459\/revisions\/209405"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/171547"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=171459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=171459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=171459"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=171459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}