SiteLint documentation and guidelines

The source filename of the image element must not be part of its text alternative

Description

Rule id: alt-text-include-filename.

The rule determines if an alternative description for the image (alt attribute) contains a filename. Basically, it searches for filenames with the following extensions:

  • apng
  • avif
  • bmp
  • gif
  • jpeg
  • jpg
  • png
  • svg
  • tif
  • tiff
  • webp

What’s wrong with using filenames as alt text?

Using filenames as alt text can be problematic because it doesn’t provide a meaningful description of the image content for screen reader users and search engines. Instead, it’s recommended to provide a descriptive text that accurately represents the image content.

How does using a meaningful description for alt text benefit search engines?

Using a meaningful description for alt text benefits search engines by providing context and relevance for the image, which can improve the image’s visibility and ranking in search results. It also helps screen reader users understand the content of the image, making it more accessible to all users.

How to fix it

Avoid setting alt attribute with a filename for the image and instead provide a meaningful description of what the image is about.

Standard

Accessibility, Best Practices, Sitelint