Site logo

Archived topic

Aria Values Invalid - Lighthouse Audit

3 replies · Started by David on March 12, 2020

Viewing posts 1–4 of 4

Lighthouse is giving me an error on every image: [aria-*] attributes do not have valid values

<figure id="attachment_4324" class="wp-caption alignnone" aria-describedby="caption-attachment-4324">

Is there a filter to replace the auto generated IDs with the actual image caption?

I've had similar issues with navigation elements not having IDs and was povided a filter from my old theme designer. Any other advice is appreciated. Thanks.

Hi there,

the aria-describedby="caption-attachment-4324" looks perfectly valid - as that attribute is meant to contain the ID ( or IDs ) of the Element(s) that provides the aria description.

Replacing its value with the actual caption would be a complete failure according to the aria spec.

The problem is you have a figure that is expecting a figcaption eg.

<figcaption id="caption-attachment-4324" class="wp-caption-text">This is the caption aria-describedby is looking for</figcaption>

Instead it looks like something has changed the markup to a span that does not contain the relevant ID.

Are you using a plugin or other code that is affecting how these images are output?

Hi David,

Thanks for your timely support.

It seems that now it's not even an issue. Sometimes Lighthouse is like that - even though I always run it in an incognito window.

So you can mark this as completed. Cheers. :)

Glad to hear that.

This archived topic is closed to new replies.