How to Disable Google AMP in WordPress

You are going learn how to disable Google AMP in WordPress. You may have your reason why you want to disable amp in WordPress.

Google is the best search engine in the world, so the amp project by Google will push developers and website owners to use amp or activate the plugin in WordPress.

how to disable Google AMP in WordPress

Normally those things that will be used by group of people, must get people complaining about it, so Google’s amp (Accelerated Mobile Pages) is an not exception.

If you want to disable amp in WordPress, don’t just deactivate the plugin, there’s steps for you to follow.

In this tutorial, you are going to learn a proper way to disable Google amp in WordPress.

How to Disable Google Amp on WordPress Website

As you have installed the amp plugin in WordPress, you will need to deactivate it.

Be it the official Google amp plugin, or other amp plugin in WordPress.

You need to Uninstall the amp plugin, to stop amp on your website.

You are not going to stop from there, because disabling Google Amp do requires more steps.

Google advice that you will start with the process by removing rell=”amphtml” link from non amp pages.

Because the code tells Googlebot that your page has amp version, so that’s why you need to stop it.

You will need a good plugin that will help you remove all the amp links and for Google to re-indexes the website.

The WordPress plugin called Real Time Find and Replace can help you do it. Install the plugin and active it.

After activating the plugin, head to Tools in your WordPress, and you will see the plugin name.

Enter the plugin and you see the add button, then tap the button and two fields will appear.

Now enter this code below in to the find field.

<link rel="amphtml" href="(.+)" >

Leave the other Replace field empty. After that, you will see a box next to RegEx. Make sure you tick the box.

Now you can tap the update settings button.

Doing so, will tell Google to stop using the amp version, and Google will stop crawling AMP page.

Setup Redirect for Amp

It may take some time for Google to notice your changes.

As you will be waiting for AMP to stop showing on search results, you will still need to setup redirects.

The redirects you are going to set will help site visitors to reach your non AMP content.

You are going to learn two ways to setup redirects, so it’s left for you to choose which is easier.

Method 1: using a redirect plugin

You are going to use a Redirection Plugin, install and activate the plugin.

After activating the plugin, go to tools in the WordPress options, and you will see Redirection.

Press the Redirection button and enter it, and you will see “Add new” button, then tap on it, after doing so, enter the following code below in the Source URL field:

/(.*)\/amp

Now check the “Regex” check box.

While in the Target URL field, enter your website domain in the following format:

https://example.com/$1

Don’t forget to replace example.com with your own domain.

Now, tap on the Add Redirect button to save the changes you made.

Method 2: Manually Set Redirects in .htaccess

If you prefer not to use a plugin to setup the redirects, then you can use .htaccess file on your WordPress hosting account.

Add the following code below at the end of your .htaccess file:

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

Save your changes, and don’t forget to to upload the file back to your server.

As you have finished setting-up redirection, you can now visit the AMP version of your post, to be sure if it’s working properly.

Comments