How to remove image title attribute on hover WordPress

How to remove image title attribute on hover WordPress

Some page builders and themes automatically add title to each image. In this video, we will see how to remove the image title that appears when you hover over an image.

Initially, all existing images have a title attribute but when the page is load, it will delete automatically by the jQuery removeAttr() method. Not the best way but for many cases, this is the exact solution. This works with Kadence, Divi theme as well as page builders that add a title tag to images automatically.

Add the following code to your Javascript code.

jQuery(document).ready(function($) {
  $('img[title]').each(function() { $(this).removeAttr('title'); });
});

About The Author

Leave a Comment

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

Scroll to Top