Automatically add Alt Tag to WordPress Image Uploads
-
Hi! This is my first post. I read the forum welcome, but odds are I’m going to screw something up anyway so cut me some slack!
What I want to do:
When uploading media to WordPress via wp-admin, the title of the media (image in this case) is automatically pulled from the uploaded file and placed into the “title” field. I’m developing a listing site where users are able to import their own photos but I don’t expect them to insert an alt tag (because most of them wont know what that is). I’d rather have the field populate as a duplicate of the title field. So, let’s say the upload is “Camp-fire.png.” WordPress would automatically fill in the following:- Title: camp-fire
- Alt Tag: camp-fire
I know there are some plugins out there that do this but I’m trying to avoid plugins as much as possible as I already have too many.
Does anybody have any suggestions for PHP functions? Thanks so much! (WP 4.5.3 on a 4GB ram DigitalOcean droplet under git Version Control)
- The topic ‘Automatically add Alt Tag to WordPress Image Uploads’ is closed to new replies.