Recently, I got the following warning in Google Search Console:
When you’re on the Google Console Dashboard, the screenshot might look some like this:
AND, Here’s a screenshot of the warning.
When I clicked on one of the affected AMP pages, I could see the following window with details of the error message.
Although I could have easily ignored this warning but I hate seeing errors. So, I decided to dig in to figure out what might have triggered the errors.
If you are seeing similar issues, read on to know how to fix it.
Run AMP Validator
Therefore, you need to go to the AMP Validator tool and enter the URL of the AMP page and hit on the “Validate” button.
The validator tool showed me the following error on the 27th line.
Therefore, I turned to Google Search to find the solution.
I used this search phrase to see if anybody has faced a similar issue: “document.location.protocol + AMP”
Luckily, I found this thread in WordPress Support.
I’ve been using Really Simple SSL plugin ever since I configured my site with SSL certificate. The plugin never really created any issues early on or maybe, I never noticed it.
Click on the save button and you’re done!
Go back to the AMP Validator tool and revalidate the affected page(s) and you should no longer any error.
Just wait for a couple of days until Google bots recrawl and reindex your AMP pages.
Here’s an updated report appearing on the 19th June, 2018, just 9 days after I fixed the errors. As you can see, the number of affected pages has automatically gone down from 41 to 23. At this rate, I’m assuming it might take one more week for Google Search to index to rest of the pages.
Hope you find this post helpful!