Guide on How to add ALT tag to images in WordPress. If you are serious about SEO, its quite important to optimize images for search engines. Only possible way is to add relevant title and ALT tags to images in WordPress. It would take just some minutes of time to optimize all images used in your blog posts.

Reasons to add ALT tag to images in WordPress
One less known fact is that one can get huge traffic from Google Images also. Some of the images used in tutorials of WPSquare are yielding some respected traffic from Google. There is no need to use any premium WordPress Plugin for that. We manually add title and alt tags to images immediately after uploading them (secret revealed).
Check: 3 WordPress Plugins to Display Thumbnails in Post Excerpts
If your articles include many images, then try to name them relevant to the post tile and optimize them by including alt tags. In this way there is a chance of getting better rankings in SERP results. One more suggestion is never use single lettered names like 2.png, 5.jpg etc for images, simply there wont be any use of doing so.
Coming to the topic, alt tags can be added to images using 3 popular methods. Lets see one-by-one in detail
Manually add ALT tag to images in WordPress
Most recommended and preferred way is to add ALT tag to images manually. After uploading images, click on “Show” link and you can add ALT tag to image directly in the pop-up media upload box.

Pretty simple right ? But this method will not help to add ALT tag to images used in all your previous articles. There is a solution for that also, check below method.
Add ALT tag using SEO Friendly Images

SEO Friendly images is a free WordPress plugin that helps to automatically add ALT tags to all images in WordPress blog. Install this plugin and configure the options by defining title and alt tags. According to SEO Friendly Images, the title tag doesn’t matter much but the ALT tag will surely helps to boost rankings, hence we recommend to try this plugin.
Automatically add ALT tag to images in WordPress
Finally, if you dont want to use manual method and if you dont want to mess up with a plugin, then here is a solution for you. This code automatically generates ALT tags to images in WordPress.
/** Auto-Generate ALT tag for images */ function image_alt_tag($content) {global $post;preg_match_all('/<img (.*?)\/>/', $content, $images); if(!is_null($images)) {foreach($images[1] as $index => $value) {if(!preg_match('/alt=/', $value)){ $new_img = str_replace('<img', '<img alt="'.get_the_title().'"', $images[0][$index]); $content = str_replace($images[0][$index], $new_img, $content);}}} return $content; } add_filter('the_content', 'image_alt_tag', 99999);
Add this code to functions.php file in your theme and update it. If you are using Thesis Theme, then ad this code to custom_functions.php file. If you need further help in adding this code to your theme, then drop a comment here.
Hope you have successfully added ALT tag to images in your WordPress blog. If you find this article useful, then do consider sharing it with others.


How to Execute php in WordPress Text Widget without a Plugin
How to Remove or Change Post Info in Genesis Theme Framework
How to Resize Images in WordPress using Aqua Resizer
Testing Cross-Browser Compatibility of WordPress Website
How to Insert Multiple Images into WordPress Post
How to Login to WordPress using Email Address
It worked like a charm. If you find SEO friendly images not working, then you should do this.
Hi Bharat,
Thank you for your article, I came across it because I’ve been searching the web for a week or so desperately trying to find an alternative for SEO friendly images as it doesn’t work on my site. I also tried manually like as you have suggested here and then located the theme functions and pasted in your code and still nothing! I really can’t seem to find another way to add alt images? Do you have any other ideas?
Thanks!
I have Tried to use it on my Blog But There is no Result.
No Error No alt tag on Images.
“Automatically add ALT tag to images in WordPress” this option is not working on my theme. It shows blank alt tag when i checked it through firebug.
EXACTLY what I was looking for regarding Alt Tags for Images. Quick and simple AND to the point (unlike other articles). Went and did this to every picture on my blog and it worked like a charm! Thanks much