Add ALT Text & Title to Images in WordPress: SEO Friendly Blog Images

How-to-add-alt-text-in-wordpress-the-maverick-spirit Pin It

When it comes to Image Optimization, I’m sure you’ve heard about alt text for at least one single time! It is considered as one of the best practice for OnPage SEO which helps you get better search engine rankings.

So, if you’re looking for an answer on, “How to add alt text and title to an image in WordPress?” , then you’ll love this piece of content.

Bonus – Have a look at my recent post, featuring SEO tips on – Image optimization!
SEMrush

“Adding an ALT tag is very easy to do, and you should pretty much do it on all of your images. It helps your accessibility, and it can help us understand what’s going on in your image.”

By: Matt Cutts, [Google]

What is Alt tag?

The Alt tag is a description that we give to a search engine so that it can know what the image is all about.

“Alt Tag (for Image Links): Alt text is an image’s version of anchor text.” 

By: Brian Dean, [Backlinko]

Remember that Google spiders don’t know what pictures are? 

So, when they crawl our post or article they read alt texts on images which ultimately helps you to rank in Google search results for a particular keyword.

Steps to Add ALT text to Images –

Implement these simple steps to bring more search engine traffic to your blog post –

The Ideal Approach – One-by-One

WordPress allows you to add Alt text to your images when you upload them using the default media up-loader of WordPress.

All you have to do is –

1. Go to your WordPress Dashboard.

2. Click on Posts and open up any post in which you want to add an image.

Go to Post to add alt tag image wordpress

3. Now click on Add Media.

4. Upload any image.

add-media-in-wordpress-post

5. After uploading the image, you will notice a WordPress image description section with some fields to be filled on the right side.

6. You can add the alt text in the Alt field, which is fourth from the top.

add alt text for seo in Alt-field

7. After entering your image alt text for SEO and title tag, click on Insert into the post and there you go. It’s done.


Note – Sometimes, there’s a possibility the theme you are using may not support the alt functionality by default.

In that case, you can add the following code in your functions.php to enable that.


function add_img_title($attr, $attachment = null) {
$img_title = trim(strip_tags($attachment->post_title));
$attr[‘alt’] = $img_title;
$attr[‘title’] = $img_title;
return $attr;
}
add_filter(‘wp_get_attachment_image_attributes’, ‘add_img_title’, 10, 2);

Additional Tips –

It is considered as a good SEO practice to fill title and caption as well. You can read about it more on Image Optimization.

  • WordPress autofill the title field with the image file name. But you can change it anytime.
  • You can also add caption just below the title field. (this text will get displayed as user hovers over the image.)

Conclusion –

Don’t forget to share your tips with me on Image Optimization in the comment section below!

4 comments on “Add ALT Text & Title to Images in WordPress: SEO Friendly Blog Images

    1. Hey Liz,

      You can! but then don’t spam by getting it on every image.. You can use LSI keywords instead.. 🙂 Let Google believe that you are writing something around your target keywords.. 😉

  1. Hi,
    I use Divi Builder and don`t work Alt in media library of WP in themes! with your code work it?
    I used and don`t work.

    Please Help me

    1. Hi Saleh,
      If you’re using Divi builder, You need to follow this process:
      1. Whenever you upload an image using Divi builder, a window with name “Image Module Settings” will get open.
      2. You need to Click on the Advanced Tab.
      3. Scroll Down and look for Image Alternative Text Field.
      4. You can write your alternative text here.

      I hope this will help you. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *