wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

ALT attribute not found for images in galleries

Open RolfKyburz opened this issue 6 years ago • 5 comments

  • [x] I've read and understood the contribution guidelines.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

My blog post (draft) has

  • one generic image (not related to post, but with an ALT attribute),
  • one header image (also generic, but with an ALT attribute),
  • one regular image with proper ALT attribute, starting with the focus key phrase
  • 9 more images, all inside galleries, all with proper ALT attribute, starting with the focus key phrase

Nevertheless, the analysis result claims that only one image has an ALT attribute with the key phrase

Please describe what you expected to happen and why.

How can we reproduce this behavior?

Technical info

  • If relevant, which editor is affected (or editors):
  • [ ] Classic Editor
  • [ ] Gutenberg
  • [x] Classic Editor plugin
  • Which browser is affected (or browsers):
  • [x] Chrome
  • [ ] Firefox
  • [ ] Safari
  • [ ] Other

Used versions

  • WordPress version: 5.0.3
  • Yoast SEO version: 9.4 (beta test readability check)
  • Gutenberg plugin version:
  • Classic Editor plugin version:
  • Relevant plugins in case of a bug:
  • Tested with theme: Exhibit 1.0.4 / GeneratePress 2.2.1

RolfKyburz avatar Jan 17 '19 20:01 RolfKyburz

I was unable to reproduce your problems. I created a new post with different images and galleries and used the keyphrase only on one single image and in all gallery images. There is no warning about the alt text and Image alt attributes: Good job! is shown.

Are there any other matters on your website or in this particular post that might influence this? Were you able to recreate this issue with an empty Wordpress install with only the necessary components (WordPress, Classic Editor plugin and wordpress-seo)? We can only investigate this issue if we are able to recreate it.

Djennez avatar Jan 18 '19 13:01 Djennez

Hmmm .... I'm not a developer, and all I'm running in terms of WP is my live copy of the blog. Let me try this: I just verified the problem with a blog post that I have published, at https://www.rolf-musicblog.net/gergiev-mariinsky-lucerne-2019-01-09/ . And here's the source for the article, with all instances of galleries disabled ("[gallery" => "[ gallery", i.e., adding an extra space). The unaltered code causes "Out of 14 images on this page, only 1 has an alt attribute that reflects the topic of your text.", whereas with the galleries disabled, the error is gone. All images, including all in the galleries, do have ALT attributes. Source_no galleries.txt.zip

RolfKyburz avatar Jan 18 '19 14:01 RolfKyburz

Sorry, I picked a bad example in my previous comment. Here's the URL for a page that has the problem: https://www.rolf-musicblog.net/joseph-maurice-weder-zurich-2019-01-15/ . In this post, all images—the single one at the top, as well as all others in galleries, have the focus keyphrase "Joseph-Maurice Weder" in the ALT text (the ALT text even starts with that keyphrase). And yet, I get the error

Image alt attributes: Out of 12 images on this page, only 1 has an alt attribute that reflects the topic of your text. Add your keyphrase or synonyms to the alt tags of more relevant images!

I have the sneaky suspicion that the problem is related to the keyphrase having a dash in it... or is this because the title of my post has "Piano Recital" preceding the keyphrase???

RolfKyburz avatar Jan 26 '19 15:01 RolfKyburz

I just want to say that same thing is happening in my case. I just checked and all images have alt set (by inspect element in Chrome), but for some reason Yoast sees only few of them (12 out 58 in this specific case). All images are inserted as two separate galleries on same page. I'm using classic editor and latest wordpress version. My keyphrases don't have any dashes. And this is not new bug or something, it's happening already for more than 6 months. I don't remember which update cased it though.

HououinKyouma01 avatar Jan 04 '20 14:01 HououinKyouma01

Happening the same here, all images with proper ALT attribute each, and Yoast is telling me that there is just one image with it, that's no sense at all. image

esreal12 avatar Oct 17 '22 00:10 esreal12