Finding images without alt text and image files that are too large
A photo comes off the camera, 4.2 MB, 6,000 pixels wide, and the content system stores it unchanged; the template scales it via CSS to 800 pixels of display width, so every visitor on a phone pulls the full 4.2 MB over their mobile connection to see an image for which a twentieth would have been enough. The alt field stays empty because it is optional. Nobody notices. It gets expensive in two separate places: image search finds no text description, a screen reader reads out “IMG_4711.jpg”, and the Largest Contentful Paint shifts by the seconds the heaviest image needs.
How to go about it in JMX
- Settings → Crawl. “Fetch images” has to be active; it is by default. Only a fetched image has a measured file size. If the images sit on a foreign host or CDN, “Check external links” is needed as well.
- The Issues tab,
Categoryfilter on “Images”. The seven image rules sit together there: image without an alt attribute, alt text too long (from 125 characters), image without width/height, image file too large (from 100 KB), image not retrievable, large images without srcset, and “probable LCP image is lazy-loaded”. - The Results tab. Switch on the “Images” and “Images missing alt” columns and sort. That way you see whether thirty pages are each missing one image or one gallery is missing sixty. The detail area shows every address with its alt text in the “Images” tab.
- The Accessibility tab. The rule “alt text is the file name” finds what the SEO check lets through: a filled attribute that describes nothing.
- The Tasks tab. Here the effort stands next to the finding. “Large images without srcset” counts as a one-off change in one place, “image without an alt attribute” repeats per page. In the issue list both show the same number.
- The Web Vitals tab. After the rebuild, fetch the LCP field data again: real visitors of the last 28 days, and only those count for Google.
What to watch out for
An alt=“” is not a finding but the correct markup for a purely decorative image; only the entirely missing attribute is reported. Fill every empty alt attribute with “image” or “photo” afterwards and you have emptied the list and made the page worse. The image rules also report one finding per page and not per image, so a gallery with sixty images without alt appears as a single row, with the affected addresses beside it as evidence: in the Issues view the first five, followed by “… and 55 more”; the task list instead names up to five affected pages. The number there counts pages. The images are counted by the Results column.
The method has a hard limit: JMX reads the <img> elements of the page; the poster attribute of <video> is fetched as a resource but feeds into no image rule. A hero image set in the stylesheet as a background-image appears in no image rule, is not weighed and cannot be given an alt text either. To the crawl it is not an image. The 100 KB is the rule’s default; the “Thresholds” tab in the settings holds title, description, word count, response time, URL length, stylesheets and scripts — the image limit is not there. If you do not want it for a photographer’s site, switch the rule off under Settings → Rules.
The LCP report is an estimate. JMX takes the first larger image in the source and skips SVG as well as anything with a declared width below 200 pixels, because those are icons and logos. Without rendering, the actual LCP element cannot be determined: with a slider or a consent layer the heuristic misses, and the rule text says so.
Replace four hundred images and do not read the field data again afterwards, and you have done work and produced no evidence.