Site logo

Archived topic

Alt and Title image attributes are absent in the source code

3 replies · Started by Oleksiy on April 28, 2020

Viewing posts 1–4 of 4

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.

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?

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 :))

Ah, glad you got it working :)

This archived topic is closed to new replies.