• Resolved xylo04

    (@xylo04)


    I’m using the Google Search Console to flag SEO problems, and it started alerting with an error:

    Disallowed attribute or attribute value present in HTML tag.
    
    The attribute 'loading' in tag 'img' is set to the invalid value 'eager'.

    I can verify that the offending attribute loading="eager" is in the AMP HTML, and I don’t see any documentation about that being an official attribute. Is this a custom attribute? If yes, should it be prepended with data- per https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes?

    If it helps, I have a support UUID: ampwp-9f8179b3-f145-555a-a154-8d6bfe387cf1.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @xylo04,

    Thanks for getting in contact with us, my name is Fellyph and I will help you today. I have looked at your website, the loading property is valid for HTML, but AMP uses a different tag for images: https://amp.dev/documentation/components/amp-img

    There is a plugin for flicker gallery, injecting invalid AMP content, if you want to keep using this plugin you can disable AMP for this particular page or use the Gutenberg gallery block, that is compatible with AMP.

    Plugin Author Weston Ruter

    (@westonruter)

    I can verify that the offending attribute loading=”eager” is in the AMP HTML

    Could you clarify this? You’re seeing loading=eager in the AMP spec? Only loading=lazy is currently allowed for normal AMP documents (ref).

    There is also loading=eager which is allowed on Optimized AMP pages which are transformed from normal AMP pages to add server-side rendering (ref).

    In general, when wanting to ensure an image is loaded eagerly it is best to omit the loading attribute altogether, as in Chromium-based browsers that allows them to follow the auto behavior that respects the user being in “data saver”?mode, to lazy-load images by default when on slow connections.

    Thread Starter xylo04

    (@xylo04)

    Fellyph, Weston, thanks for the responses. I suspect Fellyph is correct here, the Flickr Gallery plugin isn’t rendering correct AMP-safe HTML. We’re not doing anything explicit to use the loading attribute, and I don’t see any configuration in the Flickr plugin that would adjust what it’s outputting. We’ll probably just disable AMP for that page.

    • This reply was modified 3 years, 3 months ago by xylo04.

    Hi @xylo04,

    You can disable AMP only for one page at the post settings:

    About the Flickr plugin, we will investigate if we can find a solution to turn around this issue.

    As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

    .

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Disallowed attribute value’ is closed to new replies.