Skip to main content
WCAGrules
Quick navigation

Never use filenames or placeholders as alt text

F30 is a documented failure filed under two rules, non-text content and the prerecorded audio-only and video-only rule, so it reaches media alternatives as well as images. The rule underneath it is the same one F20 uses. If the text cannot be used in place of the content without losing information, it is not an alternative. Three categories fail. The first is placeholder text, the spacer and image and picture family. The second is sequence identifiers, picture 1 and 0001 and Intro#2, which look like content and defeat a pattern match. The third is filenames that are not valid alternatives in their own right, DSC_4032.jpg and Chart.jpg. That last one has a hinge in it. A filename can be a perfectly good alternative when it genuinely describes the image, so the rule is about what the text says rather than where it came from.

How we find it in an audit

Automated checks catch the obvious families with certainty. File extensions inside alt attributes, the known placeholder vocabulary, and alt text identical to the src are all mechanical. Then a reviewer reads what is left, and the category worth their time is the sequence identifiers, since picture 1 passes every pattern a tool would write. The media half of this needs a person too, because a text alternative for an audio-only recording is graded on whether it presents the same information rather than on whether it exists.

How affected users experience it

The screen reader reads "DSC underscore 4 0 3 2 dot j p g, graphic" and moves on to the next one, which is "DSC underscore 4 0 3 3". On a product page that is your whole catalog delivered as serial numbers. Placeholder text is quieter and just as useless, because image tells a listener only that something is there. What the reader wanted was the shoe.

Passes vs. fails

Passes: alt text names the product. Fails: the file name is all there is.

Passes

<img src="DSC_4032.jpg" alt="Volunteers planting seedlings in the new community garden">

Fails

<img src="DSC_4032.jpg" alt="DSC_4032.jpg">
<img src="intro-2.jpg" alt="picture 2">

How this gets tested

The W3C publishes test rules that define what a checker looks for here.

The other techniques filed under this rule

39 guides on this site are filed under 1.1.1 Non-text Content. W3C documents this one as a failure of that rule, so it describes a way the rule gets broken rather than a way to pass it.

This guide is our interpretation of W3C technique F30: Failure of Success Criterion 1.1.1 and 1.2.1 due to using text alternatives that are not alternatives (e.g., filenames or placeholder text). W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.

Go somewhere useful

Find tools, resources and your workspace.

29 destinations