Lego2012
12/13/2016 - 11:57 AM

Remove Title from WordPress Menu Links

Remove Title from WordPress Menu Links

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

<!-- 
The title attributes for your menu links can disrupt any jQuery that you’re using for a dropdown. Use this to remove it. 
-->

function my_menu_notitle( $menu ){
  return $menu = preg_replace('/ title=\"(.*?)\"/', '', $menu );

}
add_filter( 'wp_nav_menu', 'my_menu_notitle' );
add_filter( 'wp_page_menu', 'my_menu_notitle' );
add_filter( 'wp_list_categories', 'my_menu_notitle' );