This article is about how to enable an author of a multi-authored WordPress blog to insert images with title attribute in articles.
Today I noticed an important issue while editing an article written by Author Sushil. I noticed that the images in his articles were missing title attribute.
For a moment, I thought that perhaps he must had forgot to apply title attribute while uploading the image. But when I checked the image in library, it had all the four options properly filled – title, alt, caption, description.
To find-out the problem, I logged into his author account and created a test article. I always use HTML Mode to view the contents of an article (not Visual Mode). When I inserted an image into the post, it showed perfectly – caption, alt and title. However when I saved the article, to my disappointment – the title attribute vanished from the img tag (html tag to insert image).
This issue was only with Sushil’s account which is an Author account. My account which is a Super-Administrator account was successfully inserting and saving title attributes in images.
The absence of title attribute in images of Sushil’s articles was hurting his SEO score. So, here is what I did to solve the problem.
How to Insert and Save TITLE Attribute within IMG in WordPress
The solution is very simple. Follow these steps.
- Log into your website’s FTP account and download the file kses.php present in wp-includes folder.
- Open the file in your favorite text editor and insert the following line in IMG Array. IMG array will be found on line number 250. My WordPress version is 3.4.1 while I am writing this article. Insert this following one line :
‘title’ => true,
- Save the file.
- Upload the modified file into wp-includes folder by overwriting the older file.
See the image demonstration below to easily follow this tutorial.