• The altText field entered in the media library does not end up on the page. That is when I view source code in the browser, the alt= attribute with the image anchor always comes up as alt=”sitename”. I have tried deactivating all plugins. I have tried using multiple themes including themes that are tagged as “accessibility ready”, I have tried deleting the image from the media library and re-uploading it assigning the alternative text, I have tried on multiple browsers. The problem is the same regardless.This is a brand new site that I am just creating and I can’t even get the first page working. If WordPress does not support AltText, I won’t be able to use it.

    • This topic was modified 4 years, 8 months ago by paulfont.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    Which editor are you using? Block (Gutenberg), Classic, or something else?

    I cannot replicate your problem on my site using either of the above named editors. Either editor supports the alt attribute for img tags. Try viewing an img tag using the editor’s code view. If it’s correct there, you have code in a theme or plugin somewhere replacing the alt text with the site URL.

    I know you said your tried deactivating plugins and different themes. Have you tried no plugins and the twentytwenty theme at the same time? Also be aware that caching could be at play. Be sure to flush all caches, both server side and client side before you decide such a test is not doing anything.

    Thread Starter paulfont

    (@paulfont)

    Thanks so much for your reply. I am not using an editor. There are no posts and no pages yet. The only thing I have done on the site is to add a logo from the Themes -> customize -> site identity menu. I am looking at the alternate text on the logo.

    I have tried the following themes: GeneratePress, Neve, Reykjavik, Agma Blue and at your suggestion, TwentyTwenty. All plugins are deactivated. The issue is still there.
    I just tried adding a page with two images and it looks like the Alternate text attribute is being added correctly. But the alt= is still not there on the site LOGO.

    I have flushed cache on the client but not the server. I will have to look up how to do that and report back. Thanks!

    Moderator bcworkz

    (@bcworkz)

    Oh, the logo! The alt text still should be as you set it. It only should default to the site title if nothing is set. Are you sure you’ve set the alt text for the right image? When you set a logo, WP creates a copy specifically for logo use.

    That said, the exact specifics are somewhat theme dependent. Most themes use get_custom_logo() which behaves as described. Depending on what your chosen theme does, there could be a filter you could use to override the default behavior.

    Did you crop the image? There’s a known bug with the site identity image where it doesn’t retain the attachment values if it is cropped: https://core.trac.www.ads-software.com/ticket/37750

    Thread Starter paulfont

    (@paulfont)

    YES!! That was the problem. On your tip, I uploaded another image that I cropped before uploading and it retained the alt= attribute on the page. Thanks for your help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘AltText not in HTML’ is closed to new replies.