Posted on: November 23, 2022
Written by: Mick Sherry
If you’ve removed an Accelerated Mobile Pages (AMP) plugin from your WordPress website, you may need to redirect all the old /amp/ URLs back to the original, non-AMP URL.
The best way to do this is to:
Step 1: Download and install the free Redirection Plugin from the WordPress plugin repository.
Step 2: Once installed and activated, go to Tools –> Redirection to access the plugin.
Step 3: Click ‘Add New’ at the top of the screen.
Step 4: Fill out the following fields:
Source URL: ^/(.*)\/amp
URL Options: Tick REGEX (very important, won’t work without this.)
Query Parameters: Exact Match in any Order
Target URL: https://www.your-site.com/$1
Note: I shouldn’t need to say this, but make sure you replace www.your-site.com with your actual website URL
Group: Redirections
Step 5: Click ‘Add Redirect’ and it should work perfectly.
This will blanket redirect all AMP URLs back to the original non-AMP URL across the whole website.
Not using WordPress? Redirect /amp/ with the .haccess file
You can also do this using the .htaccess file if you aren’t running WordPress.
Here is a quick guide on removing /amp/ using the .htaccess file.
Only advanced users should modify their .htaccess file. If you are unsure, send a support ticket to your hosting company and ask them to implement this for you.
Why would you need to redirect AMP pages?
This is a quick/useful way to redirect your old AMP URLs to avoid 404 errors or crawl errors in Google Search Console.
You will need to do this if you’ve previously used an AMP plugin on your website that you’ve recently disabled or removed.
Thanks Michael. I have just used your description on this post to redirect all my AMP pages on WordPress as I am fed-up with AMP messing everything up. Fingers crossed it all works ok.
Thanks again
Hi Rachel,
That’s awesome. I had a quick look at your website and it seems like the /amp/ URLs are redirecting correctly.
Please let me know if you notice any issues arising from this.
Thanks for your feedback. All the best,
Michael
Hello Micheal,
I have done what you outlined above. How long does it take for everything to work again? My mobile website is not very functional since the AMP installation.
Hi Kerrese,
It should work again immedaitely after you implement the fix. What issues are you running into?
Once you’ve removed your AMP plugin and implemented the AMP redirect, any/all of your old AMP URLS should automatically redirect to the standard URL for that page. Example – exampledomain.com/services/amp/ should auto redirect back to exampledomain.com/services/
If this is not happening for you, make sure you’ve enabled the redirect and cleared any website level or web hosting level caching you may have running.
Let me know.
– Michael
Hello what if the url is like amp/s/domainname? Does this fix work?
That seems like a strange URL for AMP, I’ve never seen it done that way before.
You’d need a different URL pattern for the plugin for it to work.
I think you’d be looking at something like this but don’t quote me:
^/amp/s/(.*)
Hi Michael Sherry,
its not work for me,
how to redirect with this link?
https://www.cekidot.id/blog/ekspedisi-yang-bisa-cod/?amp=1
Hey Pandy,
If you follow the instructions I provided and use this as the regex pattern for the source URL, it should work for you:
^(.*)/\?amp=1$
Thanks it has worked for me.