Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.75k stars 885 forks source link

ALT attribute not found for images in galleries #12057

Open RolfKyburz opened 5 years ago

RolfKyburz commented 5 years ago

Please give us a description of what happened.

My blog post (draft) has

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?

1. 2. 3.

Technical info

Used versions

Djennez commented 5 years ago

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.

RolfKyburz commented 5 years ago

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 commented 5 years ago

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???

HououinKyouma01 commented 4 years ago

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.

esreal12 commented 1 year ago

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