How Do You Make a Menu Item Unclickable in WordPress?

Making a menu item unclickable in WordPress can be a handy feature if you want to keep your menu from becoming cluttered. There are a few different ways to do this, and each has its own advantages and disadvantages.

One way to make a menu item unclickable is to add a hidden field to the menu item itself. To do this, go to your menu item’s edit screen and click on the “Fields” tab. In the “Fields” tab, click on the “Add” button and enter the following code into the “Type” field:

Now, you’ll need to add the _wpnonce field to the “Nonce Fields” list in your theme’s functions.php file.

This will make sure that the field is saved in your theme and can’t be changed by someone else.

Another way to make a menu item unclickable is to add a class to the menu item. To do this, go to your menu item’s edit screen and click on the “Classes” tab. In the “Classes” tab, click on the “Add” button and enter the following code into the “Type” field:

.unclickable {display:none;}

Now, you’ll need to add the .unclickable class to the “Classes” list in your theme’s functions.

php file. This will make sure that the menu item is hidden and can’t be clicked.

Both of these methods have their own advantages and disadvantages. The hidden field method is more efficient because it doesn’t require any extra coding, but it can be less user friendly because users won’t be able to see the code.

The class method is more user friendly, but it requires more code to be added to the theme.