I need to copy my title to alt for all the media in library
-
Hello David! I have a question about WP titles im Media Library.
I used to fill only titles since 2015, leaving alt empty. Why? Inserting photos like DCIM_1234_01_02_2015.jpg automatically put this filename to “title” field. So I just changed this name to some relevant text AND it did show up in Lightbox/Colorbox when users open full-screen image.
Now I’ve updated) Gutenberg… It has problems. But. All my old posts, made in classical editor, now show same POST TITLES instead of title from medialibrary.
It’s colorbox problem, I guess, before it could take image title from Library, now, with new WP, it can’t. It can be fixed somehow, but the problem is I have no title attributes in generated html and there are empty alts.
I’m talking about standard galleries, generated by shortcode like [gallery link="file" columns="2" size="medium" ids="5776,5777"]
This shortcode processing takes alt text from ML, where it’s empty, so I have empty alt attribute in generated html – not good for users (they can’t see titles anymore), not good for SEO.
Titles are obsolete attribute, so I have an idea copy all my titles to alts for every image in database.
I have Fixit example plugin installed and can do something but not exactly what I want ?? For example, it helps put alts for single images in old posts but not for galleries because they are shortcoded. And I don’t see the way to take image title from library and put it to the ALT in the library, only options like “library→post” and “post→library” ??
Can you give me advice please? What would you do?
* new Gutenberg editor works not that way, it generates code using alt from ML if present and putting it right to the code, so Fixit can update every photo in the post, no matter single or gallery, but only in new gutenberg-made posts. Not sure if it’s better or not.. but maybe less DB queries..)UPD. The answer was “Go to MLA > IPTC/EXIC > Alt text. Set it’s priority to IPTC, template value to template: [+post_title+]”, this is what I need, all my media now havea alts
thank you for your plugin!
not sure if I need it for my usual workflow but it helped me a lot
- The topic ‘I need to copy my title to alt for all the media in library’ is closed to new replies.