Support » Plugin: AMP » Google Console Error

  • Resolved mrtechnique

    (@mrtechnique)


    I’m getting this error on Google Console:

    The tag ‘amp-iframe’ is missing a mandatory attribute – pick one of [‘src’, ‘srcdoc’].

    It’s the only error on the page. I also have Glue for Yoast SEO & AMP installed and activated. Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    The non-AMP version of that post contains the following:

    <iframe style='display:none;width:0px;height:0px;' src='about:blank' name='gform_ajax_frame_8' id='gform_ajax_frame_8'>This iframe contains the logic required to handle Ajax powered Gravity Forms.</iframe>

    The about:blank URL is invalid in AMP, so the src is getting stripped out by the sanitizer.

    Fundamentally there is a plugin incompatibility problem with Gravity Forms. There are three solutions:

    1) Contact Gravity Forms and see if they have any AMP solutions.
    2) Remove the iframe from your post, or create a shortcode that renders the frame only if ! is_amp_endpoint()
    3) We update the sanitizer to fully remove iframe elements that get a src stripped, since the absence of this mandatory attribute is then causing invalidity itself.

    Weston,

    Thanks for responding so quickly, and I apologize for my super slow reply. I just emailed Gravity Forms support about this.

    Can forms be displayed on AMP pages? If they Gravity Forms doesn’t have any AMP solutions, can you update the sanitizer?

    Gravity Forms support just responded and said that they don’t provide support for AMP yet. Could you update the sanitizer or give me the code to use for the shortcode to add in the functions.php file?

    Plugin Author Weston Ruter

    (@westonruter)

    I don’t think that there’s any specific code that can be added to the sanitizer to make Gravity Forms “just work”. It needs to be a change with how Gravity Forms works in order to be compatible with AMP.

    Bummer. Gravity Forms Support pointed me to a plugin that would have AMP display their form:

    https://ampforwp.com/gravity-forms/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Google Console Error’ is closed to new replies.