Remove Tool Tips (Titles) from Category and Page lists

By Glenn Ansley  |  June 15th, 2010  |  Published in WordPress  |  2 Comments

The following code, placed in your WordPress theme’s functions.php file will strip the title attribute from wp_list_categories, wp_list_pages. The custom menu widgets and code don’t seem to output titles.

This request was made by a client. I have no idea how many people are interested in it, but here it is:

function ft_rtt_remove_title_attribute( $output ){
$output = preg_replace('/title=\"(.*?)\"/','',$output);
return $output;
}
add_filter('wp_list_categories','ft_rtt_remove_title_attribute');
add_filter('wp_list_pages','ft_rtt_remove_title_attribute');

Responses

  1. Chris says:

    August 2nd, 2010 at 11:29 am (#)

    Glenn,

    Thanks for posting this. My client requested the same thing. Funny that I have never noticed it before but now I do on all my WordPress sites. It sure is a tiny thing, but once you see it I can understand why people want them removed.

    Thanks again!

    Chris

  2. Glenn Ansley says:

    September 22nd, 2010 at 4:45 pm (#)

    No problem!

Leave a Response