How to Completely Remove the AMP Plugin and Clean Up Residual Files
Content
Many WordPress users who try the AMP plugin encounter a common frustration: even after deactivating and deleting the plugin, traces of it remain on their website. This can manifest as lingering amp.js scripts, persistent ?amp=1 URLs, or duplicate pages that cause SEO issues. If you've decided AMP isn't for you, this guide will help you perform a complete uninstallation.
Why Does AMP Leave Files Behind?
The AMP plugin integrates deeply with a WordPress site to transform pages into valid AMP content. This process can create transients (temporary cached data) in your database for CSS and image dimensions and, in 'Reader' mode, can generate paired AMP pages. Furthermore, search engines like Google may have cached the AMP versions of your pages independently. Simply deleting the plugin from the WordPress admin does not always clear all this generated data or external caches.
Step-by-Step: Complete AMP Removal
1. Proper Plugin Deletion and Data Removal
First, ensure you delete the plugin correctly to remove as much data as possible.
- Go to AMP → Settings.
- Navigate to the Advanced Settings section.
- Check the box for 'Delete data on uninstall'.
- Click Save Changes.
- Go to Plugins → Installed Plugins.
- Deactivate the AMP plugin.
- Delete the AMP plugin.
2. Clean Up Database Transients
The plugin creates transients (cached data) in your wp_options table with names like _transient_amp_* and _transient_timeout_amp_*. These are safe to delete, though they may be regenerated if the plugin is still active.
Warning: Always create a full database backup before proceeding.
- Using a Plugin: A plugin like "WP Optimize" or "Transients Manager" can help you safely find and delete transients.
- Manual SQL Query: Advanced users can run a query in phpMyAdmin or their database manager:
DELETE FROM wp_options WHERE option_name LIKE '%_transient_amp_%' OR option_name LIKE '%_transient_timeout_amp_%';
3. Implement Redirects for Lingering AMP URLs
After uninstalling, visitors or search engines might still try to access old ?amp=1 URLs. To prevent 404 errors and consolidate link equity, redirect them to their non-AMP counterparts.
Option A: Using a Redirection Plugin
Install a plugin like "Redirection." Add a redirect rule with the following settings:
- Source URL:
/(.*)/amp - Target URL:
/$1 - Regex: Checked
Option B: .htaccess (For Apache Servers)
If you are comfortable editing your site's .htaccess file, you can add the following code. Be cautious, as an error here can break your site.
# Redirect AMP to non-AMP
RewriteEngine On
RewriteCond %{QUERY_STRING} ^amp=1$
RewriteRule (.*) /$1? [R=301,L]
Important Note: If you also use the Web Stories plugin, test these redirects carefully, as they might interfere with your stories. You may need to modify the rule to exclude the /web-stories/ path.
4. Clear All Caches
Finally, clear all caching layers to ensure your changes take effect immediately.
- Clear your WordPress caching plugin's cache (e.g., W3 Total Cache, WP Rocket).
- Clear your server-level or CDN cache (e.g., Cloudflare). Contact your hosting provider if unsure.
- Clear your browser cache before re-checking your site.
When to Seek Further Help
If your site is still broken after following these steps, the issue may be more complex. The problem could be related to a conflict with your theme or another plugin that was not fully compatible with AMP. In this case, you may need to:
- Switch to a default WordPress theme (like Twenty Twenty-Four) temporarily to see if the problem persists.
- Deactivate all other plugins and reactivate them one by one to identify a conflict.
By following this guide, you should be able to remove all remnants of the AMP plugin and restore your site to its previous state. Remember that search engines may take several weeks to re-crawl your site and de-index the old AMP pages naturally.
Related Support Threads Support
-
amp.js still there after deactivate and delete pluginhttps://wordpress.org/support/topic/amp-js-still-there-after-deactivate-and-delete-plugin/
-
AMP removing All Pluginshttps://wordpress.org/support/topic/amp-removing-all-plugins/
-
Amp still showing on url after i deletedhttps://wordpress.org/support/topic/amp-still-showing-on-url-after-i-deleted-2/
-
Please help me remove AMPhttps://wordpress.org/support/topic/please-help-me-remove-amp/
-
Remove duplicate modules in JavaScript bundleshttps://wordpress.org/support/topic/remove-duplicate-modules-in-javascript-bundles-4/
-
Duplicación de uso de discohttps://wordpress.org/support/topic/duplicacion-de-uso-de-disco/
-
How Schema Disablehttps://wordpress.org/support/topic/how-schema-disable/
-
Re-enable AMP after uninstallinghttps://wordpress.org/support/topic/re-enable-amp-after-uninstalling/
-
AMP causing all pages to break except home page when activatedhttps://wordpress.org/support/topic/amp-causing-all-pages-to-break-except-home-page-when-activated/
-
Mobile Template not removed after deactivationhttps://wordpress.org/support/topic/mobile-template-not-removed-after-deactivation/
-
AMP Pages Not Deleted After Plugin Deletionhttps://wordpress.org/support/topic/amp-pages-not-deleted-after-plugin-deletion/
-
Uninstall AMP but still problemshttps://wordpress.org/support/topic/uninstall-amp-but-still-problems/
-
How do I completely remove the plugin?https://wordpress.org/support/topic/how-do-i-completely-remove-the-plugin/
-
Hundred of entries _transient_timeout_amp* in wp_optionshttps://wordpress.org/support/topic/hundred-of-entries-_transient_timeout_amp-in-wp_options/
-
Re-enable AMP after uninstalling and redirectionhttps://wordpress.org/support/topic/re-enable-amp-after-uninstalling-and-redirection/
-
Google AMP disables WordPress outbound click statshttps://wordpress.org/support/topic/google-amp-disables-wordpress-outbound-click-stats/
-
How to delete APM version entirelyhttps://wordpress.org/support/topic/how-to-delete-apm-version-entirely/
-
Plugin deactivatehttps://wordpress.org/support/topic/plugin-deactivate/
-
Clicked deactivate and then activate and broken websitehttps://wordpress.org/support/topic/clicked-deactivate-and-then-activate-and-broken-website/
-
Delete AMP Problemshttps://wordpress.org/support/topic/delete-amp-problems/
-
Amp negative infect on my websitehttps://wordpress.org/support/topic/amp-negative-infect-on-my-website/
-
Deactivate plugins and not lose indexinghttps://wordpress.org/support/topic/deactivate-plugins-and-not-lose-indexing/
-
_transient_amp_img on databasehttps://wordpress.org/support/topic/_transient_amp_img-3600-files/