Non-clickable placeholder in WordPress Navigation Menu

Here is a really simple fix for wordpress 3+ to make non-click-able placeholder sections in a wordpress menu.

This code assumes your wordpress nav menu is called ‘sidebar_menu’.

Your nav menu might be defined in your themes functions.php file like below or you can add it as a widget using the ‘custom menu’ widget.

There is a wordpress filter that runs on every menu before it is displayed in the format wp_nav_menu_{MENU_NAME}_items

You will need to add the following code to your themes functions.php file.

Remember to change wp_nav_menu_sidebar_menu_items to reflect your menu name, for example if your menu is called main_navigation, the function call would be

2 thoughts on “Non-clickable placeholder in WordPress Navigation Menu

Leave a Reply

Your email address will not be published. Required fields are marked *