How do I fix the "CONTAINER is not supported by tag amp-img" error in AMP?

 

The following is a common error that appears when checking AMP on your product pages using Google's <href="https://search.google.com/test/amp" target="_blank">AMP Test tool.

Invalid layout property found in AMP tag
The implied layout 'CONTAINER' is not supported by tag 'amp-img'.

This error typically occurs when your description has images embedded in it, but the size of the images are not specified in the HTML coding.

For example, let's say the product's description contains an image in it that measures 100px by 100px. Perhaps it's a manufacturer's logo or some other image you've added in the description section of the product. The HTML for the image is written like this:

<img src="[store-url]/image.name" />

Under normal circumstances, an image path like this will display fine. However, for AMP display, the image must be given an explicit size for its width and height. Therefore, the image path would need to be written with size attributes like this:

<img src="[store-url]/image.name" width="100" height="100" />

So to fix this issue, simply edit your product's description so that the image(s) contained within it have their proper sizes/dimensions specified in the HTML. This way, the AMP process can correctly display the image.

Tip

If you're using Shift4Shop's built-in WYSIWYG editor for your descriptions, just click & drag onto the image in question and then click the Image icon on the WYSIWYG editor to enter the image's width and height dimensions. Just make sure to specify the actual dimensions of the image so that the display is not distorted when viewed.

Help Desk Software by Kayako fusion