blindChicken
blindChicken

Reputation: 392

AMP Errors in GSC for non-amp pages

I have created a website that has both and non-amp canonical pages. The URLs for my amp pages all end in .amp and the non-amp pages end in .html. Each amp page has the rel="canonical" link tag and the non-amp has the rel="amphtml" link tag.

These pages are essentially identical, except that in the non-amp version I have taken the liberty to include a that is used to load additional content using XHR requests (AJAX), pushState() is used to display a new URL.

In the amp version of the pages any links that would trigger the script when clicked in the non-amp version loads a new page. New page is displays the identical content as would have been seen had the request been made as an XHR request. The new page is then a non-amp version with the script added, such that any future clicks to the links are then handled via XHR and not page reload.

So that is the background. The problem is that the pages in question amp vs non-amp are essentially the same page except for a few inclusions done server side. My problem is that Google is crawling the non-amp pages and instead of viewing them as non-amp pages it is assuming that the page is an amp page with errors. I am now seeing hundreds of amp-errors in Google Search Console for the .html version of the pages and no sign that the .amp pages are even being crawled.

Among the errors reported: The mandatory tag 'link rel=canonical' is missing or incorrect.

I have checked this and there is no error, but it assumes that if the page is an AMP version than the link tag should not be rel="amphtml" it should be rel="canonical"

How do I resolve this issue? Should remove the on the non-amp version or will this simply cause another validation error?

Upvotes: 0

Views: 242

Answers (1)

blindChicken
blindChicken

Reputation: 392

I conditionally set the html tag to if the page is valid and for non-amp to . Then with link rel="amphtml" / rel="canonical" Google knows to crawl the amp version when crawling.

After fixing this I tested with Google AMP Test. I tested the .html non-amp version and it went and found the amp canonical page and validated it.

Upvotes: 0

Related Questions