October 1, 2019
Remove HREF attribute from Empty Anchor Link on WordPress Menu
Add the following code to your theme’s functions.php file to remove the HREF attribute from all the links that link to “#”,
Basically can be very useful if you’re using submenus and you want the parent item unlinked, for example.
add_filter( 'wp_nav_menu_items', function ( $menu ) { return str_replace( '<a href="#"', '<a', $menu ); } );