If I add to functions.php…
function remove_title_attr(){
?>
<script>
(function($) {
$(window).on('load', function(){
$('#wrap_all a').removeAttr('title');
$('#wrap_all img').removeAttr('title');
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'remove_title_attr');
… it works great at hiding the tooltip, but it also hides the text under an image in the lightbox which is a Caption in the Gallery element. So it would seem that Gallery element captions share the same attribute as a tooltip? Anyway I can differentiate? I don’t want to show tooltips over gallery images, but I do want to show the Gallery image caption when the lightbox is being used.
if you only want it for img and anchors – use instead:
function temporary_removal_title_tags(){
?>
<script>
window.onload = function() {
var links = document.querySelectorAll('a , img');
for (var i = 0; i < links.length; i++) {
var link = links[i];
link.onmouseover = function() {
this.setAttribute("org_title", this.title);
this.title = "";
};
link.onmouseout = function() {
this.title = this.getAttribute("org_title");
};
link.onclick = function() {
this.title = this.getAttribute("org_title");
};
}
};
</script>
<?php
}
add_action('wp_footer', 'temporary_removal_title_tags');
Thank you @Guenni007, that works!