START here

Google AMP case study

I wrote in great detail about what AMP is (including the pros and cons), as well as how to implement AMP on a WordPress website. After having been running AMP for years, I’ve decided to do a case study, testing website performance once it is removed – tracking all the relevant metrics (visitors, average page load times etc.).

Table Of Contents (T.O.C.):

  1. Introduction
  2. How to disable AMP for WordPress
  3. AMP case study test setup
  4. AMP enabled – statistics
  5. AMP disabled – statistics
  6. Conclusion


1. Introduction

I’ve been running AMP for years, being one of its early adopters. It looked very promising: offering faster page-load times for smartphone users with slower and/or limited Internet bandwidth. This is achieved via well-optimized content (with stricter limits on what can, and what can’t be used), and also by serving the (cached) AMP-content versions from Google’s servers (this last option has been “discontinued” in the meantime).

The downside is it’s quite limiting in terms of website functionality and design options it allows. Also, it is an extra complication for website maintenance (requires extra time to test everything upon WordPress updates for example).

Another downside is that I can’t control Google AdSense ad placement with AMP. So the ads get placed in between article paragraphs. This does earn more money, but it is distracting for the readers. Sure – a non-AMP website version is only one click away, and the ads get loaded only after all the text and article images have been loaded, but it’s still not perfect. I can only turn off the AMP ads completely. That also doesn’t sound right: I’m making some great content, offering it for free, and the least I can do is make some income from the ads – at least enough to cover my expenses.

I’ve also heard rumours that Google is planning to ditch the AMP project support altogether. For example, AMP statistics is still not implemented in Google Analytics Version 4, and the deadline for implementing the V4 instead of the old version is July 2023 (so roughly a year from now).

While I remain very sceptical about Google ditching this project, I think it doesn’t hurt to do a test and see how my site(s) perform without AMP. Just to be prepared for anything.

For testing, I’m using my cycling website version in my native. Why? Mobile Internet speed in my country is still relatively poor, plus I’m bound to get some high-quality feedback from users (even if it includes my mother and a dog in the same sentence 🙂 ).

– T.O.C. –


2. How to disable AMP for WordPress

My websites are configured to use a query parameter for AMP content versions. Thanks to this, once AMP is disabled, all the potentially existing links to the AMP will automatically show the matching non-AMP content version as if nothing had happened practically.

Still, to be on the safe side, and speed up the re-indexing process, I’ve added this .htaccess redirect:

#BEGIN Redirect from AMP to non-AMP
RewriteCond %{QUERY_STRING}    "amp=" [NC]
RewriteRule (.*)  /$1? [R=301,L]
#END Redirect from AMP to non-AMP

That redirection is a “permanent” one (“301 redirection”) that redirects any AM-Page visitors (that end with a “?amp=1” suffix) to a matching non-AMP page version (with the same link, just without the suffix).

So, practically all I had to do was disable (and later delete) the WordPress AMP plugin, comment-out any AMP-related WordPress child theme code, and add the above-shown code to the .htaccess file on my hosting server.

Deactivate (1) and delete (2) any AMP-related WordPress plugins
Deactivate (1) and delete (2) any AMP-related WordPress plugins
Picture 1

If it’s of any help, here’s my AMP-related WordPress child theme code:

/*
BEGIN DISABLING AMP - EXPERIMENT

// BEGIN disable header Element for AMP
add_filter( 'generate_element_display', function( $display, $element_id ) {
    // Tell the non-AMP Element not to appear.
    if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() && XXXXX === (int) $element_id ) {
        $display = false;
    }

    return $display;
}, 10, 2 );
// END disable header Element for AMP

// BEGIN ads for AMP - goes into footer
$print_amp_auto_ads = function() {
  $ad_client = 'ca-pub-XXXXXXXXXXXXXXXX'; // @your client  ID
  if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
    ?>
    <amp-auto-ads type="adsense" data-ad-client="<?php echo esc_attr( $ad_client ); ?>"></amp-auto-ads>
    <?php
  }
};
// For Paired/Native mode.
add_action( 'wp_footer', $print_amp_auto_ads );
// END ads for AMP - goes into footer

// BEGIN comments for AMP - goes after main content
$gremlin_amp_comments = function() {
  if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
    ?>
<p>If you have any <strong>problems with posting a comment</strong> (via a smartphone),<br />, visit the <a title="Questions &amp; Answers page" href="https://bike.bikegremlin.com/9583/questions/" target="_blank"><strong>Questions &amp; Answers page</strong></a>.</p>
    <?php
  }
};
// For Paired/Native mode.
add_action( 'generate_after_main_content', $gremlin_amp_comments );
// END comments for AMP - goes after main content

END DISABLING AMP - EXPERIMENT
*/

– T.O.C. –


3. AMP case study test setup

The test setup is quite simple. I’ll compare Google Analytics stats for a 45-day period with AMP enabled, then I’ll disable AMP, give it a few days to settle and re-index, and track stats with AMP disabled for 45 days.

  • AMP enabled 45-day period: May 1st 2022 – June 14th 2022.
  • AMP disabling: June 15th 2022.
  • AMP disabled 45-day period: June 17th 2022 – July 31st 2022.

For tracking performance, I’ll be using Google Analytics, since it provides feedback from real user experience, unlike generic tests.

The testing period aligns with the cycling season in my country, so I don’t expect to see any seasonal fluctuations affect the test results.

– T.O.C. –


4. AMP enabled – statistics

Here are the visitor stats with AMP enabled:

45-day stats for the number of visitors and pageviews with AMP enabled
45-day stats for the number of visitors and pageviews with AMP enabled
Picture 2

And here are the page load times:

45-day stats for the average page load time with AMP enabled
45-day stats for the average page load time with AMP enabled
Picture 3

– T.O.C. –


5. AMP disabled – statistics

Here are the visitor stats with AMP disabled:

45-day stats for the number of visitors and pageviews with AMP disabled
45-day stats for the number of visitors and pageviews with AMP disabled
Picture 4

There’s a noticeable drop in the number of visitors, but some 10 days after I disabled AMP on this site, all the BikeGremlin websites got removed from Bing (for reasons that are still unexplained). So I’m not sure how much disabling AMP has affected these results.

What about speed?

45-day stats for the average page load time with AMP disabled
45-day stats for the average page load time with AMP disabled
Picture 5

These stats show a bit slower average page load times, but were also affected by a couple of other changes:

  • Hosting provider and server change
    I moved to MDDHosting because HostMantis was sold and I was no longer sure what the quality of service will be. From a London server, the website was moved to Denver USA, to a slightly slower server.
  • I experimented with a different monetization platform
    Had a brief, 10-day run with Setupad, that killed the performance while it lasted.
  • Website optimization platform change
    From mid-July to the beginning of August, I tested Cloudflare Pro and WordPress APO. This didn’t fare very well, especially for smartphone visitors (for desktop, it was good).

– T.O.C. –


6. Conclusion

Website maintenance, without worrying about AMP version stability and performance is easier. One less thing to worry about.

Did disabling AMP negatively impact performance and the number of website visits? I’m not sure – my results are inconclusive. There were too many things that changed during my testing. Some of it was forced, and some of it was my fault.

It could be argued that most of the changes were for the worse, so that a minimum drop in the number of visits and the slightly slower performance were most probably not because of the AMP disabling. However, I can’t say that with enough certainty. You can’t do an experiment while changing so many parameters.

Having said that, I have decided to ditch AMP. It’s much easier doing website maintenance without any worries about the AMP version, and I’m looking for other ways to optimize and improve performance.

– T.O.C. –


Please use the BikeGremlin.net forum for any comments or questions.

If you've found any errors or lacking information in the article(s) - please let me know by commenting on the BikeGremlin forum.
You can comment anonymously (by registering with any name/nickname), but I think it is good to publicly document all the article additions (and especially corrections) - even if their author chooses to remain anonymous.

Skip to content