tutorial Web Development WordPress

How to add and fetch alt tags in images WordPress

Images are the milestone for any website without which a site looks mundane and visitors feel tedious exploring it. Almost every website has images in their contents and pages but their owners don’t optimize them properly and skip the process, image optimization. You should always enhance the images you add in your content so as to make them perceptible in the search engine results. So if you have heard of SEO and want to implement it on the images of your site then you’ve come to the right place and it’s like a piece of cake!

When it comes to optimizing images, the two most significant aspects are the alt tag and title. WordPress provides a very easy way to add them while uploading an image.  Most people are confused between the two but we will shade light on this matter as well.

Difference between alternate text and image title

The alternate text or the “alt tag” is an attribute inside the image HTML tag. As the name implies, search engines filter out user queries from the alternative texts from the image tag. Moreover, it is also helpful when the images can’t be found. Image title, on the other hand, is also an attribute added inside the image HTML tag which serves as the title of the image. The image title pops up when you hover the mouse over an image.

Now, after the insight into the alt tag and image title, let’s begin with adding them while uploading an image. There’s a built-in image uploader in WordPress where you can step by step add the image title, caption, image size and alt tag.


You can add alt tag by navigating to Media > Library and clicking on the image you want to optimize and edit. However, the title “Image Optimization” is not the image title attribute that we are talking about. It is just a name of the image file which makes easier to arrange the media items in the library. To add the actual image title attribute, you should click on the image and proceed with the optimization. You can do it while adding media files from the text editor.

In the frontend, the image title appears when you hover a mouse over the image.


Never skip adding the alt tag and image title while uploading an image. It not only it enhances the SEO but also gives clarity to users on what the image is about. And for the developers if you have trouble fetching alt tags and image title inside the image HTML tag, here’s a simple code you can follow.

image optimization

We hope this article helped you through the image optimization process and also cleared your confusion about the difference between image title and alt tag. For more articles, you can keep up with our blogs in codepixelz.com.