metal-gogo
metal-gogo

Reputation: 343

How to fix: Referenced AMP URL is not an AMP

Search console added a bunch of issues with "Referenced AMP URL is not an AMP".

If I use the AMP Test I get:

Not a valid AMP page error

However, when I check in https://validator.ampproject.org/ it shows:

Validation Status: Pass

Here is a list of some of the URLs that the Search Console says are not valid AMP pages:

I don't understand what Google expect me to fix.

Upvotes: 4

Views: 13034

Answers (2)

metal-gogo
metal-gogo

Reputation: 343

It turned out that I had several issues.

First I needed to correct all the links between the AMP version and the standard version of the pages.

After that, Craig Scott was right about the redirection, it was against the Google Search guidelines for AMP to redirect the traffic that came from desktop or tablet.

However, I had another huge problem not directly related to the code on AMP.

We are using Prerender to help crawlers read the content of our page rendered with React, but it returned an invalid version of the page to the crawler of the AMP pages.

To fix this last issue I blacklisted the AMP pages (that doesn't even use custom JS!) for prerender.

Upvotes: 1

Craig Scott
Craig Scott

Reputation: 902

Going to add an answer here as well... you could try something similar to what is described on this page which talks about mobile vs. desktop site re-directs. In particular this bit:

<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.example.com/page-1">

You have your canonical and amphtml links set-up correctly though, and the AMP Test detects the amphtml link if you run your non-AMP page through it - it's just your re-direct kills it I think. If you drop the 302 re-direct you're doing and run the AMP Test again it will probably validate.

You can probably drop the re-direct all together as Google will crawl and find the amphtml link in your header and serve that to mobile users in their search results. If you're concerned about re-directing direct visitors to your AMP version as well, then the alternate link option I linked above may be worth a shot.

Upvotes: 1

Related Questions