[Resolved] Alt and Title image attributes are absent in the source code

Home Forums Support Alt and Title image attributes are absent in the source code

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1260062
    Oleksiy

    Hi, guys,

    I’ve faced a strange issue.

    Alt and Title attributes are present in the Media Library. But absent in the source code. I use Classic. And Shortpixel Image Optimizer for compression and usage of .webp.
    At the moment .webp is organized by adding <picture> tag to the source code. But using .htaccess result in general is the same (in this case alt tag itself is present in the code, but with an empty value).
    Important that alt is absent for images that were added via Image Gutenberg Block. For other images, like featured image, alt exists. Title is present only for .svg logo.

    I’ve found this topic – https://generatepress.com/forums/topic/images-alt-text/. But it looks like not my case.

    Please, help to fix it

    Thanks.

    #1260376
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    GeneratePress itself doesn’t have any control over your content markup.

    The title and attribute tags should appear automatically in WordPress. Perhaps once of those plugins is removing them? Have you tried with the plugins deactivated?

    #1260707
    Oleksiy

    Yes. I have tried to deactivate Shortpixel. This plugin is not guilty.
    Native Gutenberg Image Block is. To have alt and title in Media Library is not enough anymore. You need to add them additionally to block settings. Very useful update from WordPress developers :))

    #1261516
    Tom
    Lead Developer
    Lead Developer

    Ah, glad you got it working 🙂

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