{"id":791,"date":"2024-05-07T11:43:24","date_gmt":"2024-05-07T11:43:24","guid":{"rendered":"https:\/\/kb.shortpixel.com\/docs\/i-receive-the-following-image-s-are-missing-width-and-or-height-attributes-when-testing-with-gtmetrix-why\/"},"modified":"2025-08-27T08:43:07","modified_gmt":"2025-08-27T08:43:07","password":"","slug":"i-receive-the-following-image-s-are-missing-width-and-or-height-attributes-when-testing-with-gtmetrix-why","status":"publish","type":"docs","link":"https:\/\/kb.shortpixel.com\/knowledge-base\/article\/i-receive-the-following-image-s-are-missing-width-and-or-height-attributes-when-testing-with-gtmetrix-why\/","title":{"rendered":"I receive &#8220;Use explicit width and height on image elements&#8221; when testing with GTmetrix, why?"},"content":{"rendered":"<p>\n\t If you started using<br \/>\n\t<a href=\"https:\/\/wordpress.org\/plugins\/shortpixel-adaptive-images\/\" rel=\"noopener\">ShortPixel Adaptive Images<\/a> on your website and right after you installed it ran a <a href=\"http:\/\/gtmetrix.com\/\" rel=\"noopener\">GTMetrix<\/a> test and you notice this error:<\/p>\n<p>\n\t<img decoding=\"async\" src=\"https:\/\/kb.shortpixel.com\/wp-content\/uploads\/2025\/08\/file-RzhAdMl4US.jpg\" style=\"width: 1152px;\"><\/p>\n<p>\n\t You should know that SPAI only replaces the URL of the image but it doesn&#8217;t touch the attributes of the<br \/>\n\t<code>img<\/code>&nbsp;tag. So, if your website is not adding the <code>height<\/code> and <code>width<\/code> attributes to the <code>img<\/code> tags, then GTmetrix will complain.&nbsp;<\/p>\n<p>\n\tPlease notice that ShortPixel Adaptive Images already delivers the images with the correct dimensions, and it even adds a blank placeholder before the actual image is loaded so no layout shift happens, therefore&nbsp;<strong>you can safely ignore this warning<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you started using ShortPixel Adaptive Images on your website and right after you installed it ran a GTMetrix test and you notice this error: You should know that SPAI only replaces the URL of the image but it doesn&#8217;t touch the attributes of the img&nbsp;tag. So, if your website is not adding the height [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[35],"glossaries":[],"doc_tag":[],"class_list":["post-791","docs","type-docs","status-publish","hentry","doc_category-shortpixel-adaptive-images"],"blocksy_meta":[],"year_month":"2026-04","word_count":109,"total_views":"1156","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"admin","author_nicename":"admin_mdli53m5","author_url":"https:\/\/kb.shortpixel.com\/author\/admin_mdli53m5\/"},"doc_category_info":[{"term_name":"ShortPixel Adaptive Images","term_url":"https:\/\/kb.shortpixel.com\/knowledge-base\/category\/shortpixel-adaptive-images\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/comments?post=791"}],"version-history":[{"count":1,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/791\/revisions"}],"predecessor-version":[{"id":2474,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/791\/revisions\/2474"}],"wp:attachment":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/media?parent=791"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_category?post=791"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/glossaries?post=791"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_tag?post=791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}