Site logo

Archived topic

alt-text for SVGs are not available in front-end source

5 replies · Started by Hardik on May 30, 2021

Viewing posts 1–6 of 6

Hello,

I'm using Safe SVG plugin (as suggested by many users on this forum) to safely upload SVGs into WordPress Media Library and using some of them under Generatepress Elements to design a global sitewide footer. These SVGs are being added using the default image block.
I have inserted alternate text for the SVGs inside the Media Library but to my surprise, they are not available in the front-end source code for the search engines to digest. This happens with SVGs only. I've tried clearing cache but to no avail.

Any pointers in this matter will be very helpful.

Thanks!

Hi there,

I feel like this would be a image block issue which is a WordPress core block.

Let's go through some debugging steps.

- Is the alt tag added in a normal images like .jpg or .png using the image block?

- I doubt this matters but what if you add the SVG image inside the normal page content without GB?

- Does the same issue exist in a Twenty series WP theme?

– Is the alt tag added in a normal images like .jpg or .png using the image block?

I created a page (keeping Generatepress as the theme) and 2 JPGs and SVGs using image blocks. alts are visible.
On the same page I assigned it's own dedicated footer. On that footer block element, I added the same 4 images and to my surprise, alts are visible.

Hence, I believe something's wrong with either the image block in the global footer element or that global footer element is bugging out.

The image block builds static HTML, so if the alt is visible in the editor HTML, it should be visible on the front-end as well.

Maybe try completely deleting the image block from the footer element and add a fresh one?

Thank you, alts are now visible on the front-end source after deleting and adding fresh image blocks.

Great to hear :)

This archived topic is closed to new replies.