Viewing 7 replies - 1 through 7 (of 7 total)
  • I’m getting warnings from Google console too when my site usually runs fine.

    I’ve listed them below for my site https://www.1stdrive.com/

    Error – The tag ‘BODY’ appears more than once in the document.
    Error – Only amp-boilerplate and amp-custom ‘style’ tags are allowed, and only in the document head.
    Error – Custom JavaScript is not allowed.
    Error – Tag or text which is only allowed inside the body section found outside of the body section

    I did recently post some code into the header section of the AMP plugin under the advanced section. I wanted to show a Facebook like button at the top of each page and I think maybe that’s what was causing it so I have removed it.

    After running some tests through Google console I can confirm it was my custom code that had caused the issue.

    Sorry for that, keep up the brilliant work and I hope your site is fixed soon perdigao2430.

    Thread Starter perdigao2430

    (@perdigao2430)

    I only have the code to the AMP ads from Google Adsense on the header section.
    So, I’m no sure what the problem is.

    I’m very new to AMP but from what I can tell you’re not supposed to have anything like adverts in the header section.

    Maybe that’s wrong but I only had a facebook like button and it didn’t like it.

    Try removing the Adsense code then running a live test on the page through Google console.

    – Log in to Google search console (the new one)
    – Click on AMP on the left sidebar
    – Click on the error message under where it says “type”
    – Hover over the page under where it says “Examples” and click on the magnifying glass that appears
    – Click “Test live URL” at the top right

    If it shows it as fixed with the Adsense code removed then that would be the issue.

    Thread Starter perdigao2430

    (@perdigao2430)

    But Google itself recommends to put that code on the header.
    So, how can I have that code working on my AMP pages?

    Plugin Contributor ampforwp

    (@ampforwp)

    Hi @perdigao2430,

    When Ads are enabled, the plugin automatically adds the Ad code script in the head. No need to add the extra script in the head. And it’s just a warning, not an error. However, You can remove the code from the ‘Advanced settings’ and validate your AMP URL on this site: https://validator.ampproject.org/

    Hope it helps.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘AMP component ‘script’ tag is present more than once’ is closed to new replies.