Site logo

[Resolved] ALT tags not appearing on single image featured posts

Home Forums Support [Resolved] ALT tags not appearing on single image featured posts

Home Forums Support ALT tags not appearing on single image featured posts

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2410515
    Brett

    Hello, I am having an issue seeing the ALT tags for the featured image/header image on the pages of single listings on my site. This is a sitewide global issue, as I have added ALT texts to all the featured images. There’s something in the code that isn’t displaying the ALT text. Would you mind taking a look please?

    #2410645
    Fernando
    Customer Support

    Hi Brett,

    GeneratePress doesn’t interfere with the image functions used in the post content. Yes, we can take a look.

    Are you using a plugin to alter images? Can you try #1 here to test?: https://docs.generatepress.com/article/debugging-tips/

    #2411193
    Brett

    Hey Fernando, I am using the WP Rocket and Shortpixel plugins for performance, but they shouldn’t be altering the images. I tried step 1 as suggested and didn’t see any change other than performance declines.

    As a note, the site is built on GenteratePress blocks, so it’s a fully custom build. I am curious to know if the developer accidentally set things up in the wrong way? It’s not a standard build, so I’ll rely on you to give it a second look.

    #2411232
    David
    Staff
    Customer Support

    Hi there,

    plugins that optimize / convert images actually swap out the HTML. In this case they replace the <img> HTML that WP generates for a <picture> element.

    If i check the source code of the site i can see that process has occurred.

    And in the noscript copy of the image code, which generally keeps most of the original HTML intact, i can see the alt tag.

    See here:

    https://www.screencast.com/t/5QKDdoRFTfL

    So somewhere between the optimization, webp conversion and lazyloading the ALT tag has been misplaced in the outputted picture element.

    #2411801
    Brett

    Got it, thanks. I’ll reach out to WP Rocket and Shortpixel to see if it’s something that is happening with their plugins. I appreciate the help!

    #2412347
    David
    Staff
    Customer Support

    You’re welcome

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.