Yoast / wordpress-seo

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

Analysis fails to detect Images in a Cover Image Block #11241

Open Pcosta88 opened 6 years ago

Pcosta88 commented 6 years ago

Please give us a description of what happened.

The analysis fails to detect Images in a Cover Image Block

Please describe what you expected to happen and why.

It would

How can we reproduce this behavior?

1.Create a post and add in a Cover Image Block

screen shot 2018-10-11 at 10 35 48 am

2.See Yoast not detect image

screen shot 2018-10-11 at 10 36 10 am

Technical info

dariaknl commented 6 years ago

The issue is reproduced in Yoast SEO 8.4.

IreneStr commented 6 years ago

@moorscode Can you please get more context on this issue?

moorscode commented 6 years ago

The Cover image is currently being rendered as background-image in the CSS. This means that it is not in an <img tag and lacks alt or src-set attributes.

@jono-alderson can you provide insights in how this affects SEO indexation for such an image and if we should ignore or somehow include this in our analyses.

Example output:


<div class="wp-block-cover-image" style="background-image:url(http://local.wordpress.test/wp-content/uploads/2018/06/b117ef7fc4ed851f99f23f10795b2010.jpg)"><p class="wp-block-cover-image-text">Cover Image Title<br/><br/></p></div>
jonoalderson commented 6 years ago

My general thoughts are that, if an image conveys meaning, it should be in an image tag. If it's just decorative, a background is fine.

Historically, large cover style images have been implemented via CSS in order to attain levels of styling capabilities/flexibility which have been historically difficult to achieve via an image tag, without relying on js. Nowadays, image tags are flexible enough.

As such:

1) I don't think we should be analysing images in backgrounds, as, semantically, these aren't/shouldn't be part of the flow.

2) We should educate on this.

3) even if we did want to analyse these, how do we do so reliably and robustly? Where do we draw the line between "image we should analyse", and, "jpg background on an element"? How do we discern the intent?

moorscode commented 6 years ago

So for a very small change, the copy could be adjusted to "No usable images appear on this page" and the article could explain which images are SEO worthy and which are not.

jonoalderson commented 6 years ago

I like it.