Problem/Motivation
The help text for the "Alternative Text" input in Image Field Widgets suggests that it can be used for SEO (emphasis mine):
This text will be used by screen readers, search engines, or when the image cannot be loaded
While it's certainly true that search engines like Google appear to make use of image text alternatives, they are not the intended audience. It's quite common to find images where an author has used the ALT attribute for SEO keyword stuffing, and it's very unhelpful for any of the intended scenarios. I don't want to encourage that in Drupal's UI.
The W3C HTML 5.1 recommendation does not list SEO as a benefit of ALT. See 4.7.5.1. Requirements for providing text to act as an alternative for image.
In fact neither the HTML 5 / 5.1 recommendations nor the Understanding WCAG 2.0 working group note make any mention of search engines in relation to Alternative text for images.
Proposed resolution
Remove the suggestion that this should be used for SEO.
Suggestion from comment #4 is:
Replacement text for use when images are not available. Important for screen readers.
Update the description for "text alternative" in ImageWidget.
The ImageWidget settings form also needs updating.
Remaining tasks
Write a patch.
User interface changes
Minor change to the description of the "text alternative" field in ImageWidget.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | Alternative Text Description .png | 30.47 KB | seangambierross |
| #20 | Enable Alt Field Description.png | 34.49 KB | seangambierross |
| #17 | 2878238-16.patch | 2.44 KB | kolin |
| #17 | interdiff-2878238-6-16.txt | 2.61 KB | kolin |
| #6 | imagefield-alt-not-for-seo-2878238-6.patch | 2.32 KB | andrewmacpherson |
Comments
Comment #2
andrewmacpherson commentedJoomla uses this help for Alternaitve Text (screenshot attached):
(Thanks to Brian Teeman from the Joomla project for providing a screenshot of this.)
Comment #3
andrewmacpherson commentedFWIW, I don;t much like the way the Joomla description for text alternatives uses the word "access". It's overloaded, and may be confused with field permissions or such.
The HTML 5.1 recommendation describes the alt attribute this way:
Comment #4
andrewmacpherson commentedHow about:
Comment #5
andrewmacpherson commentedComment #6
andrewmacpherson commentedThis patch changes the Image Widget and the field settings form.
Updating issue title, it's not just about the field widget plugin.
Comment #7
manuel garcia commentedThanks @andrewmacpherson for this.
The text makes sense, the patch is simple enough - good to go in my opinion.
Comment #8
andrewmacpherson commented@manuel Thanks for RTBC, but I'm still not completely sure about the best way to phrase this. I'm going to ask for some feedback from the Drupal a11y slack channel. Ideally we'll find a succinct way to convey the usefulness of text alternatives.
I looked for the history of the alt-text description in core, to see if there was any discussion behind including the search engine phrase. It turns out this description has been in use since the image field widget was added to core, in #560780: Add Image Field to image.module.
The search engine advice came about in contrib, in the days of imagefield-5.x-2.x, in #366078: improve ALT text field description. The mention of search engines was a deliberate ploy to get people to provide ALT text at all, though without much discussion.
There's a non-FieldAPI alt text input being introduced at #2780293: Add GUI to configure the site's logo alt attribute too.
Comment #9
mgiffordMaybe, rather than listing the reasons that someone should add alt text, we simply state it as a best practice.
"Adding meaningful alternative text to your images is the best way to ensure that everyone can benefit from your content."
I think I had a better wording for that a while ago, but is there any reason not to just keep it general and as a best practice?
Comment #13
andrewmacpherson commented@mgifford
I like that idea. Let's try ideas long this line.
Comment #14
kolin commentedPicked this up at Drupal Camp Scotland.
Comment #15
kolin commentedComment #16
kolin commentedComment #17
kolin commentedComment #19
seangambierross commentedI've picked this up at #uoecontributiondayAug2018
Comment #20
seangambierross commentedI've applied this patch and reviewed it. Replacement text has been applied and updated. Everything looks good and is working as it should.
I've also attached some screenshots for reference.
Comment #21
andrewmacpherson commentedThanks for working on this, @kolin and @seangambieross. Patch #17 correctly maker the text changes suggested here.
However we have a duplicate issue which has had more discussion, and is RTBC now. I'm closing this one. and transferring your credit over there. I couldn't find this issue for a while.