Google AMP

How to Safely Disable AMP in WordPress

Pinterest LinkedIn Tumblr

When Google first announced its Accelerated Mobile Pages (AMP) project, most publishers were excited to get on the bandwagon. After all, who wouldn’t want to cut down their page load times to a fraction? Consequently, thousands of publishers signed up to use the technology. What’s more? It delivered on its promise of speed.

Why Publishers May Want to Disable AMP

Fast forward a few years, a lot of publishers have realized that AMP just isn’t cutting it for them. There are many reasons for this but the most commonly-cited ones:

  • Implementing AMP did not create any noticeable increase in search traffic
  • It is tricky to properly setup analytics and advertising for AMP pages
  • AMP uses a restrictive set of HTML/JS, which leads to loss of functionality
  • AMP pages show Google’s URL (‘google.com/amp/…’) instead of the publisher’s original

If you want to know the pros and cons of AMP in greater detail, developer Alex Kras’s post ‘I decided to disable AMP on my site’ is a great read. To Google’s credit, the AMP development team has been continuously working to iron out known issues and make things easier for publishers. Case in point, Google recently announced that AMP will start displaying publishers’ original URLs using ‘Signed Exchanges’.

Still, if you’re one of the publishers who wants to stop using AMP for any one of those reasons, don’t make the mistake of simply turning it off and thinking you’ll be alright.

How AMP Works

Okay but, why can’t you just turn it off? Well, let’s how recap AMP works. AMP makes webpages load faster on mobile web by stripping away all non-essential page elements like excess CSS and third-party JS—but that’s only one part of why AMP webpages load so fast.

In order to make the delivery of the webpages even faster, Google also keeps a cached copy of the AMP pages and loads the webpage from its own servers when requested by the user. Which is why you see the ‘google.com/amp/…’ in the URL.

Why You Need to be Careful

Now let’s say you want to disable AMP and just go ahead and do it. Remember, Google still has hundreds or thousands of your webpages indexed in its cache, which it will display in the search results as and when users search with related keywords.

If a user clicks an AMP link for a website on which AMP has been disabled, he/she will encounter a ‘404 Not Found’ error. This can harm your website in two ways: First, users are not able to reach your webpages, and second, Google penalizes websites for 404 errors. If left unchecked, the effect on your search traffic can be disastrous.

So, how do you safely disable AMP? If your website runs on WordPress, you’re in luck.

Step 1: Disable AMP in WordPress

There are more than one plugins that enable AMP functionality for WordPress websites. If you’re using one of those plugins, go ahead and deactivate the plugin.

Step 2: Setup Redirects with a Plugin

To ensure that you’re not losing out on any search traffic due to broken AMP pages, you will need to redirect users from AMP pages to regular mobile webpages. This again can be handled by a plugin such as Redirection. First, install and activate the plugin.

Next, add the following code in the source URL field:
/(.*)\/amp

In the target URL field, you need to add your website’s URL in this format:
http://example.com/$1

Remember to replace example.com with your website’s domain name. Now check the Regex checkbox and select Redirections under the Group drop down menu. Finally, click on the ‘Add Redirect’ button to save your changes.

Step 2 (alternative): Manually Set Redirects in .htaccess

If you don’t want to use a plugin to set redirects, you can also directly add a rule in the .htaccess file. In order to access this file, you can use File Manager in cPanel or FTP. You will find the file in the website’s root folder. Once you locate the file, simply add the following code at the bottom:

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

In order to check if the redirects are working fine, just click on any AMP webpage from your website in the search results. Your AMP page should now redirect to the original URL.

Disabling AMP is a quick fix on WordPress. However, if you’re not running a CMS on your website, you may want to look into the official Google documentation for disabling AMP and do it the proper way, so that you can safeguard your search traffic and SEO authority.

Remember, AMP may not work for you but it is extremely effective when it comes to cutting down page load times. If you choose to serve your webpages without AMP, you should still test the page speed on mobile and execute optimizations to reduce latency.

Write A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.