Viewing 3 replies - 1 through 3 (of 3 total)
  • Have you tried looking at the ‘text’ tab in your WYSWYIG editor for that page in WordPress (instead of the ‘visual’ tab)? My experience is that usually there’s some styling code that’s carried over when you cut and paste from YouTube (or other video embedded code sources) that’s messing the iFrame up. AMP validation is more sensitive to these things.

    Check for things like " in the embed code, etc.

    Thread Starter joneiseman

    (@joneiseman)

    No, nothing messed up about the original iFrame. Here’s the original non-amp iFrame:
    <iframe width="580" height="326" src="https://www.youtube.com/embed/6O1Bu_934mI?ecver=1" frameborder="0" allowfullscreen=""></iframe>

    Here’s the amp version

    <amp-iframe width="580" height="326" src="https://www.youtube.com/embed/6O1Bu_934mI?ecver=1" frameborder="0" allowfullscreen="" sandbox="allow-scripts allow-same-origin allow-popups" sizes="(min-width: 580px) 580px, 100vw" class="amp-wp-enforced-sizes">
    </amp-iframe>

    Then I go to this page to validate the amp verion: https://validator.ampproject.org/
    Here’s what it says on that page about the amp-iframe:

    The tag ‘amp-iframe’ requires including the ‘amp-iframe’ extension JavaScript. Learn more.

    Plugin Contributor ampforwp

    (@ampforwp)

    Hi @joneiseman,

    Please add the below code in the “Enter HTML in Head” option. You will get this option in AMP > Settings > Advanced settings > Enter HTML in Head. Screenshot: https://take.ms/olv7j

    <script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>

    Hope it helps.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘amp validation error on amp-iframe’ is closed to new replies.