• I’m getting the following error in Google Search Console for my AMP pages…

    The tag ‘amp-iframe extension .js script’ is missing or incorrect, but required by ‘amp-iframe’.

    Anyone else run into that, or know how to fix it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you want to use iFrames you have to have the line below in your <head> to bring in the supporting script.

    <script custom-element=”amp-iframe” src=”https://cdn.ampproject.org/v0/amp-iframe-0.1.js&#8221; async></script>

    For me the AMP plugin is adding it successfully but I had to include the line below in my custom template to make it happen (if you aren’t using a custom template then I think the plugin should take care of this):

    <?php do_action( ‘amp_post_template_head’, $this ); ?>

    If the above code is working you should also see the canonical to the non AMP page and the line below:

    <script src=”https://cdn.ampproject.org/v0.js&#8221; async></script>

    If you don’t see either of those then you need to work out why the action isn’t happening. If the others are there then you need to work out why it isn’t also adding the iframe code. It looks like it only adds it if it detects the requirement so maybe your iFrames aren’t valid? If all else fails you could add the line to your template manually – I’d at least try that to confirm that it’s the problem.

    Clicknathan

    (@clicknathan)

    It looks like it adds it right out of the box to me, and then if you don’t have an iFrame, that’s when Google gives the warning:

    The extension ‘amp-iframe extension .js script’ was found on this page, but is unused (no ‘amp-iframe’ tag seen). This may become an error in the future.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Amp-iframe extension .js script’ is closed to new replies.