Unless used with care, title attributes can be annoying or confusing to screen reader users. When screen readers encounter a link with a title attribute, they may read the title attribute instead of the link text, before the link text, after the link text, or not at all. It depends on which screen reader it is, how it is configured, and the content of the title text. Adding title attributes to every link does not improve accessibility – it can have a negative impact. On top of that, title text is unavailable to some users – see Don’t use the title attribute for essential information for more info on that.

So the title attribute should be used with care, not just routinely added to every link.

I’m not alone in wanting to remove the title attributes from WordPress – there is even a plugin called Remove Title Attributes. Using that plugin is an option of course, but if you’re like me and want to keep your WordPress installs as plugin-free as possible, you can clean out the title attributes yourself by adding the following to your functions.php file:

This little regular expression looks for title attributes whose values can be surrounded by either single or double quotes and deletes them. It isn’t foolproof as it will have problems if an attribute value contains escaped quotes of the same type as the opening quote. That said, I haven’t seen it trip on any of the title attributes produced by WordPress yet. Just something to be aware of if you notice something weird when using this regexp though.

The simplest way to use it is to add it as a filter to the WordPress function that you want to remove title attributes from, like wp_list_pages in the example.