Title: Error when showing AMP version
Last modified: December 2, 2020

---

# Error when showing AMP version

 *  Resolved [MartijnAtWordPress](https://wordpress.org/support/users/martijnatwordpress/)
 * (@martijnatwordpress)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/)
 * Hi,
 * Hope somebody can help/ advise me on the following issues.
 * **PROBLEM:**
 * AMP doesn’t work correctly anymore. On mobile, it doesn’t pick up the AMP version
   automatically.
 * When I enforce the setting “Redirect mobile visitors to AMP” (Which should not
   be necessary), it still shows some issues when opening the AMP version.
 * _Note: AMP is only enabled on posts within the category “Hotel News” and “Travel
   News”._
 * **ISSUE 1: Error message when visiting AMP page**
 * _EXAMPLE:_
    When clicking on an AMP URL within Google Mobile Search, it shows
   first the following message “Sorry this page is not valid AMP HTML”, before it
   is redirected to the AMP version.
 * Please see an example video of the situation: [https://test123456.nl/test-2/](https://test123456.nl/test-2/)
 * PLEASE NOTE: When checking the AMP version via [https://search.google.com/test/amp](https://search.google.com/test/amp),
   The page is valid and has no errors.
    – Example AMP version for mobile: [https://test123456.nl/amp-version](https://test123456.nl/amp-version)(
   Desktop version: [https://test123456.nl/non-amp-version](https://test123456.nl/non-amp-version))
 * _NOTE: to reproduce the exact issue can be difficult since:_
    1) The outcome 
   differs (sometimes there is no error message) 2) Sometimes the URL is visible
   as an AMP and sometimes as NON-AMP version within Goggle Mobile search (See issue
   2)
 * **ISSUE 2: The same URL not showing as AMP in Search**
 * The same day the URL can be visible within mobile search as AMP and then as NON-
   AMP page. It somehow switches between AMP and NON-AMP.
 * Please see the example: [https://test123456.nl/test-2/](https://test123456.nl/test-2/)
 * I hope I explained my case well.
 * I am looking forward to hearing from you.
 * Kind regards, Martijn
    -  This topic was modified 5 years, 8 months ago by [MartijnAtWordPress](https://wordpress.org/support/users/martijnatwordpress/).

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/error-when-showing-amp-version/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-when-showing-amp-version/page/2/?output_format=md)

 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13735629)
 * From inspecting your site I first noticed you don’t have a redirection in place,
   with your non-secure (http) site accessible.
 * Your amphtml link ([screenshot](https://i.imgur.com/5JJo7Pw.png)) also references
   your URL without any scheme/protocol. it’s recommended to use `https`
 * It may also be worth checking any optimization or caching plugins for minification
   options, I noticed a Cloudflare reference in the video you provided which may
   also have such features.
 * Alternatively, we would like to know if you have made any major changes recently(
   Added a plugin, enabled cache etc )
 * If you find the same results please share your Site Health information via [this](https://docs.google.com/forms/d/1JTQmphDlk9YgHpDoFRbHXpkDqv8-QmzTT7MDR4AstyQ/)
   form so we can check your setup
 *  Thread Starter [MartijnAtWordPress](https://wordpress.org/support/users/martijnatwordpress/)
 * (@martijnatwordpress)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13736048)
 * Thank you [@milindmore22](https://wordpress.org/support/users/milindmore22/) 
   for your feedback. I’ll appreciate it!
    I’ll have a look at your suggestions.
   I’ll keep you updated.
    -  This reply was modified 5 years, 8 months ago by [MartijnAtWordPress](https://wordpress.org/support/users/martijnatwordpress/).
 *  Thread Starter [MartijnAtWordPress](https://wordpress.org/support/users/martijnatwordpress/)
 * (@martijnatwordpress)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13744556)
 * Hi [@milindmore22](https://wordpress.org/support/users/milindmore22/),
 * I have an update and a followup question.
 * We fixed your first remark (Redirection issue) and working on the caching/ minifications)
   and mad already some improvements.
 * Question:
    How can we change the amphtml link to HTTPS? Do we have to reinstall/
   configure the AMP plugin, so it picks up the “new HTTPS URL”? Or is there another
   way?
 * Kind regards, Martijn
 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13745061)
 * No, you don’t need to reinstall the plugin, this might be because of the HTML
   minification feature you have enabled.
 *  [data1online](https://wordpress.org/support/users/data1online/)
 * (@data1online)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13745439)
 * Dear Milind,
    Thanks for pointing that out. I also speak on behalf of martijnatwordpress
   and wonder how I can influence the link in the amp by turning off minification(
   cf / ao / rocket). If I turn off all minification, would it automatically generate
   the new https protocol link? because then I can only turn it on and off? Doesn’t
   it seem to me that there must be a way to be able to access this manually outside
   of the minification?
 *  [data1online](https://wordpress.org/support/users/data1online/)
 * (@data1online)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13745672)
 * > Your amphtml link (screenshot) also references your URL without any scheme/
   > protocol. it’s recommended to use https
 * How can we provide a protocol for these links If the links are generated automatically?
 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13746780)
 * Hi [@data1online](https://wordpress.org/support/users/data1online/),
 * Check if you can add an exception for the rel=”amphtml” while doing HTML minification.
 * Also please check [amp_get_permalink](https://amp-wp.org/reference/hook/amp_get_permalink/)
   filter.
 * It will be very helpful if you share site health information via [this](https://docs.google.com/forms/d/1JTQmphDlk9YgHpDoFRbHXpkDqv8-QmzTT7MDR4AstyQ/)
   form so we can understand your setup better and provide better assistance.
    -  This reply was modified 5 years, 8 months ago by [Milind More](https://wordpress.org/support/users/milindmore22/).
 *  Thread Starter [MartijnAtWordPress](https://wordpress.org/support/users/martijnatwordpress/)
 * (@martijnatwordpress)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13748535)
 * Hi [@milindmore22](https://wordpress.org/support/users/milindmore22/), I just
   filled in the form with the site health information.
 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13754936)
 * Hello [@martijnatwordpress](https://wordpress.org/support/users/martijnatwordpress/)
 * Thanks for the info, I’m unable to reproduce the same issue from my side. Can
   you try to check whether the same issue arises when you activate plugins one 
   by one following the steps below:
    1. Install and activate the [Health Check & Troubleshooting plugin](https://wordpress.org/plugins/health-check/).
    2. Navigate to Tools > Site Health > Troubleshooting.
    3.  Enable trouble shooting mode
    4. Visit plugin -> installed plugins and activate them one by one and check which
       plugin is causing issue
 * You can exit troubleshooting mode afterward.
 *  Thread Starter [MartijnAtWordPress](https://wordpress.org/support/users/martijnatwordpress/)
 * (@martijnatwordpress)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13754976)
 * Hi [@milindmore22](https://wordpress.org/support/users/milindmore22/),
 * Hope you had a good weekend.
 * **– Question regarding:**
    _“Check if you can add an exception for the rel=”amphtml”
   while doing HTML minification”_ Where can we add this exception?
 * **– Regarding: **
    _“Also please check amp\_get\_permalink filter”_ Please see
   [https://pastebin.com/D1wSxm00](https://pastebin.com/D1wSxm00). I am not what
   to check.
 *  [data1online](https://wordpress.org/support/users/data1online/)
 * (@data1online)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13755905)
 * Hi [@milindmore22](https://wordpress.org/support/users/milindmore22/), before
   diving deeper into the context I am wondering if you suggesting a plugin is blocking
   the code from showing the amphtml? or screwing up the HTTPS protocol?
 * I have CF’s all redirect to HTTPS activated so all connections now go to HTTPS
   but still pages do not move to the amp link when visiting an amp-paged post I
   guess due to the fact it’s still not showing the HTTPS protocol in the amp URL.
   
   How can we refresh those URL’s so all URLs convert to https inside the code, 
   can Avada theme blocking something?
 * I cannot find a way to make an exception of “rel=”amphtml”, only files can be
   excepted in Autoptimize and Cloudflare does not show me an option either.
 *  [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13755961)
 * just fyi: Autoptimize doesn’t act on AMP-pages, so nothing to configure there
   🙂
 * frank (ao dev)
 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13756193)
 * Hello [@data1online](https://wordpress.org/support/users/data1online/) and [@martijnatwordpress](https://wordpress.org/support/users/martijnatwordpress/)
 * I am suggesting that one of the plugins or your theme might behind this
    as you
   can check on your non-AMP page, it stripped `https` protocol from several other
   tags also (check this [screenshot](https://prnt.sc/vxp6ht) ), it’s not AMP plugin
   specific issue.
 * to find which plugin/theme might be the cause of this please follow the instruction
   which I posted earlier.
 * [@optimizingmatters](https://wordpress.org/support/users/optimizingmatters/) 
   Thank you for your input, the link on `<link rel="ampthml"` is on non-AMP page.
 *  [data1online](https://wordpress.org/support/users/data1online/)
 * (@data1online)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13756194)
 * Thanks AO I know this but I have to make clear what kind of minify Is in place
   since Milindmore22 is pointing out to except something around it.
 *  [data1online](https://wordpress.org/support/users/data1online/)
 * (@data1online)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/#post-13766122)
 * [@milindmore22](https://wordpress.org/support/users/milindmore22/) Thanks for
   the reply.
 * The website has added or changed little to no plugins over time, the theme has
   always remained the same and AMP has once run successfully in the same composition.
   The fact that there is no https: reference in the code now (screenshot) is when
   you look deeper in the console a reference to an https address so I’m not sure
   if this is causing the problem or if this is something that stands out but the
   problem is not increased by it.
    The goal is that google does not sometimes **
   but always** call every amp-available pages where we now sometimes see and sometimes
   not an AMP indication when searching via google and / or visiting the page via
   google. The 2nd goal is that all pages that contain an AMP version also call 
   the AMP version via direct links on the site, currently, no page does that, only
   google points to AMP pages.
 * If you indicated that minification for the above could be a problem, would you
   suggest that wp rocket, autoptemize and cloudflare all need to be minication-
   disabled in order to determine whether the problem takes place in minification
   or has something more to do with google?
 * finally, to prevent a redirect loop with Cloudflare, a redirect to HTTPS has 
   been removed from the access and taken over in Cloudflare by “redirect all” via
   their ssl, could this be a problem for google to determine if an page has https
   +amp?

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/error-when-showing-amp-version/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-when-showing-amp-version/page/2/?output_format=md)

The topic ‘Error when showing AMP version’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

 * 16 replies
 * 4 participants
 * Last reply from: [Milind More](https://wordpress.org/support/users/milindmore22/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/error-when-showing-amp-version/page/2/#post-13766880)
 * Status: resolved