Cloudflare causing AMP Error in Google Search Console

Hello, Cloudflare is causing me some AMP Error across my website pages. Please how do I resolve the following four AMP Error issues as seen in my Google webmaster?

Error 1: Only amp-boilerplate and amp-custom ‘style’ tags are allowed, and only in the document head.

Error 2: Custom JavaScript is not allowed.

Error 3: Tag or text which is only allowed inside the body section found outside of the body section.

Error 4: Disallowed attribute or attribute value present in HTML tag.

Example of my page with error: https://www.fanslite.com/kendall-jenner-frank-ocean-take-ice-cream-ny-city/amp/

Please help!

I’ve also encountered those errors from my amp validation addon on my browser. But I never really saw it as a problem from Cloudflare. Thanks for making me realize that.

But before I go on to suggest what might help you fix it, may I ask, do you see these errors in your GSC when you test the live pages?
Or you just see it in the native amp addon?

@ukprospery truth is I am not really sure this is Cloudflare causing, but Cloudflare seem to be last thing I implemented on my website.

Meanwhile, I am seeing this Errors in my Google Search Console.
Please I will appreciate any helpful suggestions.

@huyhoa I also have similar problem! I think Cloudflare is causing me some AMP Error. Please how do I resolve the following four AMP Error issues as seen in my Google webmaster?

Error 1: Only amp-boilerplate and amp-custom ‘style’ tags are allowed, and only in the document head.

Error 2: Custom JavaScript is not allowed.

Error 3: Tag or text which is only allowed inside the body section found outside of the body section.

Error 4: Disallowed attribute or attribute value present in HTML tag.

Example of my page with error: https://www.fanslite.com/kendall-jenner-frank-ocean-take-ice-cream-ny-city/amp/

Please help!

Validation Status: PASS
(both Google and AMP Project)

I think I was able to fix this, but I am waiting for the Error fix update from Search Console which I know may take few days for Google to update the Error status.

I had to change the AMP plugin I was using, and it seemed it worked! Although till I confirm from Google search console Error Update I requested from them. Thanks for your response!

Hopefully, Cloudflare could be the culprit here. I have those errors too and any help will be appreciated, but I really don’t worry about them since it doesn’t show errors in my GSC and AMP validator. My pages appear well without errors on Google search.
It could be that Cloudflare made core changes that made it incompatible with AMP on CMS like WordPress, Blogger, etc

I also noticed that sometimes, my pages load well without errors.

@ukprospery here is thing, your page will load fine, but when you go to your AMP side of the GSC, you will notice this errors. Okay? Meanwhile, which AMP Plugin are you using?

I was using AMP for WP, and what I did was to disable that particular plugin and then install AMP Project Contributor (Which they said is the Official WordPress AMP Plugin), and then I ran a quick check on AMP validator and the page passed successfully.

So, I requested Google search console to analyze all the pages again, so I am waiting for update which may take few days. But then when I checked an individual page, it showed AMP Valid which seem to mean the issue is resolved.

So I cannot say if the problem was from the previous AMP plugin I was using. (Although of recent I added Adsense code to one of the spaces meant for such code for Ads to display on the header of my AMP pages), I cannot say if these contributed to the issues. Though it seemed google search console had detected the issue earlier on before I added the Adsense code to the AMP page header via the AMP for WP plugin.

Right now, I am waiting for GSC to validate all the page to be AMP valid before I will find a way to put back the adsense codes to show in the header (Even though the current AMP plugin, “AMP project contributor” seem not to have such option for me add the Adsense code.

I know it’s a long read already, but I had clarify things more, it could help.

1 Like

You should try auto ads for amp page by Google Adsense. Check it here:

Or if you want to add it manual, you can try to install plugin that support add manual ads on AMP suggested by Google Adsense here:

I am using a custom AMP for Blogger platform. Here is my site: wwwdotknowseekerdotcom.
If individual pages passed the live page test, then you are good to go.
If you preferred the previous plugin, and the individual pages also passed GSC, you really don’t need to worry about it.

In my browser AMP validator addon, I frequently get 7 amp errors, but when I debug, the errors are not seen. Site passes AMP test on GSC too.
Therefore, the error could be from the Add-on too.

The plugin may be the culprit too, not cloudflare. Not exonerating cloudflare though but these are possibilities.

My recommendation is, if you prefer the functionality of the previous plugin to this one, try testing if the pages passed GSC on it too. And if it does, I personally don’t see any reason not to continue with it.

@ukprospery with the previous plugin, the pages did not pass the AMP test. That’s why I switched to the other plugin which also gives me a limitation (I cannot place adsense on my page header). Looking for how to go about this with the current plugin, because I really need the Ads to show on my AMP page headers.

I have used Ad inserter and Quick Adsense, but they will not show the ads on header for AMP pages.

@huyhoa thank you for these suggestion. Although I have tried to use one their recommended plugin but it wouldn’t show ads on header. So annoying, I don’t know what to do.

My previous AMP plugin allowed me place the Adsense code on header, but the plugin caused me some AMP errors as I complained before. Still looking for a way out to this.

Alright.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.