Archived topic
Unable to add Alt tags to images
5 replies · Started by Mary Pearson on December 9, 2021
I am starting to edit https://easternhillsrenovations.ca/flooring/ for SEO.
Rank Math tells me to
"Add an image with your Focus Keyword as alt text."
I have added alt tags to my images in the media library, but they are not showing up in the coding, and if I add the alt tag manually in the code editor, as soon as I update, it disappears.
Example:
If I add the alt tag of "flooring" in the Code Editor
<!-- wp:generateblocks/container {"uniqueId":"ba4ae159","innerContainer":"full","minHeight":400,"paddingTop":"0","paddingRight":"0","paddingBottom":"0","paddingLeft":"0","verticalAlignment":"flex-start","isDynamic":true,"blockVersion":2} -->
<!-- wp:cover {"url":"https://easternhillsrenovations.ca/gay-content/uploads/flooring-1400x400-1.jpg","id":1705,"contentPosition":"center center","align":"full","className":"has-parallax"} -->
<div class="wp-block-cover alignfull has-background-dim has-parallax"><img class="wp-block-cover__image-background wp-image-1705" alt="flooring" src="https://easternhillsrenovations.ca/gay-content/uploads/flooring-1400x400-1.jpg" data-object-fit="cover"/><div class="wp-block-cover__inner-container"><!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->
As soon as I update, the word "flooring" disappears.
Can you tell me how to deal with this please. I have requested support from Rank Math and they suggest I ask the theme author.
Many thanks!
Hi Marry,
You are using a Cover block to add the image, Unfortuanly GP has no control over how this block behave Unfortuanly.
Thank you. What block should I be using?
Hi Mary,
You can try recreating the same layout with a GenerateBlocks Container block with a headline block in it.
Set a background image and add padding-top and padding-bottom to the container block to control the size of the cover section.
Since the image is a background image, you shouldn't need to assign an alt for it.
Thank you so much Elvin. I was unable to create as you suggested but found another block "Media and Text" and it is working perfectly for me.
Thank you again to you and Ying.
No problem. :D