Forward AMP pages to non-AMP after disabling the AMP plugin for WordPress

project AMP (Accelerated Mobile Pages) was designed to help users benefit from Internet connection the weaker (3G) can quickly access web pages on Mobile Phones si smartphones.
Both bloggers and large websites have incept to use this structured format for mobile webpages, but many wanted after a while quit the AMP. Designed as a project to make the web faster and to provide users with a simplified interface for the pages accessed, AMP did not like the webmasters who installed and used it for a while on WordPress. Either they had a low conversion rate, either decreased traffic from mobile devices, or they could not correctly implement their ad networks Google AdSense and others.
It is certain that Google encourages us to use AMP and prevents webmasters from postponing the possibility that non-AMP websites may not receive too many visitors from mobile devices.

If you have come to this article, most likely you used AMP for a while, you are disabled AMP plugin for WordPress and now you are confronted with many 404 pages in Google Console.
After activating the AMP plug-in for WordPress, URLs pages and Articles will have the end "/ amp". These "/ amp" URLs will have simplified pages as design and features, in line with the AMP project standards. Pages will also be indexed with the new URL in Google Search, then served to users when they search for something relevant to reach your website page.

The problem occurs when you decide to drop the WordPress AMP for X reasons. Disable the AMP plugin for WordPress it is very simple. We're going in DashboardPlugins → click "Deactivate". In Google Search, however, the URLs will be indexed with the ending "/ amp", and when they are accessed they will return "Error 404 - Page Not Found". Since the link is no longer valid, Google Console will see a massive increase in the "not found" pages. Pages containing "/ amp" at the end of the URL.

The most elegant solution is that after disabling the plugin on its Dashboard permanently redirected (Redirect 301) "/ Amp" URLs to their normal version. Without "/ amp".

How to permanently redirect a AMP link to a non-AMP link in WordPress

We take the scenario in which we have web pages of the form:"And we want to redirect them to""

It still depends on what web server you are using. Apache or NGINX.

How to permanently redirect a link ending with "/ amp" to a non-AMP link on Apache

Apache uses the .htacces directives. Edit the .htaccess file in the root of the domain and add the following lines:

RewriteEngine On
RewriteCond %{REQUEST_URI} (.+)/amp(.*)$
RewriteRule ^ %1/ [R=301,L]

Save the .htaccess file and check in the browser by going to a former "/ amp" page.

NGINX - redirection "/ amp" to the non-AMP page of the article

Edit the nginx.conf file of the domain for which you want to redirect and add the rewrite line to the "server {... server"

rewrite ^/(.*)\/amp$1 permanent;

Save the file and restart the "nginx" service on the server.

After restart, all URLs ending with "/ amp" will be redirected to the same URL without the WordPress AMP plug-in.

Forward AMP pages to non-AMP after disabling the AMP plugin for WordPress

About the author


Passionate about everything that means gadget and IT, I am pleased to write on from 2006 and I love to discover new things about computers and macOS, Linux operating systems, Windows, iOS and Android.

Leave a Comment