Support » Plugin: AMP for WP - Accelerated Mobile Pages » Invalid value for attribute in layout ‘width’ in tag ‘amp-img’

  • Resolved Jay


    Google Search Console is showing me this error every once in a while. The problem is in this little snippet of code:

    <amp-img src="//" width="" height="" sizes="(min-width: 0px) 0px, 100vw" class="amp-wp-enforced-sizes"></amp-img></div>

    IT’s am Amazon Associate image link. The product with ASIN code B00IOWOPD4 has disappeared and an image can no longer be loaded.

    This causes the width and the height parameters to become empty. This is not a valid value and causes Search Console to complain about it.

    It’s understandable that no dimensions could be determined for a non existing image. However, the default values should be 0, rather than empty string.

    Can this be fixed?

    • This topic was modified 1 year, 4 months ago by  Jay.
Viewing 13 replies - 1 through 13 (of 13 total)
  • Проблема может быть в относительном адресе
    Относительный адрес //
    абсолютный выглядел бы так
    Хотя я могу ошибаться
    В моем случаи проблема была связанна с плагином HTTP/HTTPS

    • This reply was modified 1 year, 4 months ago by  punch6.

    I’m getting the same error as Jay. Happy for any input.


    Punch6’s Russian comment reads that the problem might be in the relative address.

    It’s not, though. The others are working just fine. It’s caused by the fact that Amazon product pages sometimes disappear. No image can be loaded for that particular image url.

    The plugin simply needs to default to 0 in case it can’t determine any value due to the fact that no image is available.

    Hi All,

    We are getting the same error as from today pointing to the same issue all be it with the amplogo

    <amp-img src=”” width=”” height=”” alt=”The White Isle – Ibiza Blog” class=”amp-logo” layout=”responsive”></amp-img>

    Despite trying to set the logo height and width the boxes remain empty.

    Any help deeply appreciated

    Best wishes


    Hi @jwbats

    Can you please tell us how you are implementing this Amazon Associate image link in AMP? can you please send us that code so that we can test on our end and will get back to you.


    Are you also using this same Amazon Associate image link ad on your site?


    Actually, you are getting the AMPlogo error, so Can you please contact me directly on

    I will personally make sure that your issues get resolved immediately and also please mentioned that you came from the forums.

    @beingsmart: No, I used the page builder for a handful of pages to see what google thinks of it and these were the errors.



    I implement the Amazon Associate image as shown in the above code snippet.

    However, the above code snippet no longer yields an image, because the product page for the ASIN (product id) used in it no longer exists.

    For this reason, you should use the snippet I posted above in order to reproduce the bug.

    Here’s the same code snippet with a different ASIN for a product page which does still exist (at the time of writing):

    <img border="0" src="//">

    You can paste this bit of code into a page (using inspect element, even) and load the page and it should work.


    It seems the latest update has fixed the issue for us thank you.

    Actually I just got an email saying I have that issue on this page.

    I’m on 0.6.2. Any suggestions?

    Get: Invalid value for attribute in layout ‘width’ in tag ‘amp-img’
    First detected: 9 May 2018

    Due to this: <amp-img src=”” width=”” height=”” alt=”Life Movement Australia Chiropractic” class=”amp-logo” layout=”responsive”></amp-img>

    Any idea what i need to do to fix this? Sounds similar to the above, have the most recent update/

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Invalid value for attribute in layout ‘width’ in tag ‘amp-img’’ is closed to new replies.