On our site we have a case where we show a list of images that have been uploaded by various users of a product we sell. We don’t have any context as to what the image is of other than the product we’re selling on the page. Here’s the various options we’ve discussed:
- Empty alt tag
alt=""
. Screen readers would read nothing. - Alt tag saying it was user uploaded
alt="customer uploaded content"
. This would repeat the same thing for every image. - Same thing as (2) but instead giving an index for the image to show the number of them there are
alt='${index} customer uploaded content'
. - Omit the alt attribute entirely.
I am less concerned about SEO in this specific case than I am accessibility. I’m not sure what the best practice is and if having screen readers read out repetitive content could potentially be bad.
4
Answers
I’d say to put it like this:
It says what product is in the image, and that is was uploaded by a user.
assuming that you are building an dynamic web-app you can attept the try of Tobias and insert dynamic content in the alt tag. otherwise i think you have to stick at solution 2) since you cant dynamize content in html.
The specification has exhaustive information about the
alt
attribute including a section Images whose contents are not known:(snip)
Make it easy for screen reader users to skip the section. Make use of
<section>
elements and<h1>
and friends. That way when they get the announcement "Section: Customer photos", they can skip to the next heading.Best Practice: ATAG
The best practice would be to acknowledge that your site is an authoring tool, as it allows creating content, and to conform to the Authoring Tool Accessibility Guidelines (ATAG).
This would mean (among others) that you
I’m a screen reader user myself, and I would vote for #1, or maybe #3, depending on the situation.
Your #4, no alt text, is in any case the worst one. Many screen readers render images without alt by giving the file name or even the full URL. It is always a totally useless annoyance.
Your #2, a generic alt text like “User uploaded content” is better, but if there are more than a few images in a row, less experienced users may think that they have reached the bottom of the page, or that the screen reader and/or the website are buggy.
For more advanced users, it’s anyway no useful information.
Your #3, a generic alt text with indices like “Photo 1”, “Photo 2”, “Photo 3”, “Photo 4”, etc. is better than #2. Since the alt text differs by their indices, you can’t think that you have reached the end of the page or that something is buggy.
It’s still no useful information.
However, I think that the best of your solutions is #1, an empty alt text.
Since the images provide anyway no useful information, they are better entirely skipped. In practice, that’s what we do everyday when such such images are present.
There is one case where I would recommand #3 instead of #1 though: if you can do some action by clicking on the images.
IN this case, the empty alt text would prevent a screen reader user from launching the action. Image links, buttons and other actionnable elements must always have a non-empty alt text.
Another case when #3 might be useful is if I’m myself the author of the content. IN that case I might want to check if my images have correctly been uploaded and inserted where I want them to appear.
IN all other cases, I would go for #1, for the reasons explained above.
Of course, the real best solution would be to allow users to give an alt text while they edit their content, and educate them about it.
You may argue that it’s a description and that it would help them finding back their images; very useful if you give access to a place where they can see all what they have uploaded on the site in a single page, or if you allow them to upload images in advance.