Last updated on

Menus are a very important part of website navigation, especially when using WordPress. Sometimes you may want to create a submenu to one or more menu items. In some of these cases, the top link acts more as a category name and will not need to link to a page of its own. This article demonstrates how to create a top level menu item, and how to disable that top menu item link in WordPress. This feature is available in all of our WordPress themes found in our WordPress website builder product.

Disabling the Link Attribute to a Top Level Menu Item

  1. Log into your WordPress Dashboard.
  2. Click on the Customize link from the left hand menu.
  1. Customizer Menus option highlightedClick on the Menus option.
  2. Customizer Menus primary menu selection highlightedSelect the menu you want to work with.
  3. Primary menu Add Item button highlightedClick on the Add Items button.
  4. Add Item Custom Link fields highlightedClick on the Custom Link option. Name it (Link Text) and give it a URL.
  5. Custom Links Add to Menu button highlightedNext, click on Add to Menu.
  6. Drag n Drop Sub-Menu Clients Page menu item indented below Top Menu Custom Link menu itemNow, drag the items you want in the sub menu under the new custom link item. Sub-menu items are indented to easily identify the menu structure.
  7. Custom Link edit menu item arrow highlightedClick on the Custom Link edit arrow.
  8. Top Menu Custom Link blank URL field highlightedRemove the URL from the URL field.
  9. Save and Publish button highlightedClick the Save & Publish button.

Now, when visiting your WordPress website, the Top Menu menu item will reveal the sub-menu and not function as a link by itself. This is helpful if you want to minimize the number of pages you want to manage, and focus on your sales or information pages more.

Before: After:
Primary Menu Before Primary Menu After highlighted

 

Disable a Menu in WordPress

The easiest way to disable a menu in WordPress is to remove the menu from it’s assigned location in your WordPress dashboard.

Navigate to Appearance > Menus > Manage Locations to see all menu locations in your active theme. Below we have 3 menus – Main Menu, Social Icons, and Sticky Main Menu. If you do not want a menu to appear in a location, change the dropdown to read Select a Menu. In the example below, the Sticky Main Menu location will not display a menu. When you’re finished, click the blue Save Changes button.

Working with WordPress Menus

If you’d prefer, advanced users can unregister a menu location from the functions.php file. Below is an example to unregister a menu named primary, taken from the WordPress official documentation.

unregister_nav_menu( 'primary' );

We recommend using the Code Snippets plugin to make changes to functions.php. Any changes made in the core theme files could be overwritten when the theme updates.

Test WordPress Updates Safely

If you get nervous making php changes we have a safe environment for you! You can create a free WordPress installation with BoldGrid’s Cloud WordPress service. This demo website is in the cloud, not tied to your live site. This means any changes you make in the cloud version of your website will NOT show on your live site.

Use a WordPress backup plugin to clone your site to the cloud. After making your changes, take another backup and restore on your live site.

Congratulations! You now know how to create a top link menu item, and disable it so that it only works as a dropdown for your menu. This particular article explains how to make this change using our WordPress Website builder, BoldGrid Inspirations and our classic WordPress Themes. If you would like to have a few more options for your WordPress website, feel free to check out our new SuperTheme Crio – A WordPress theme for business.

 

SIGNUP FOR

BOLDGRID CENTRAL  

   200+ Design Templates + 1 Kick-ass SuperTheme
   6 WordPress Plugins + 2 Essential Services

Everything you need to build and manage WordPress websites in one Central place.

7 thoughts on “How to Disable a Top Menu Item Link

  1. The top menu item I’d like to be unclickable has an Elementor Mega Menu attached. I cannot move the mega menu and attach it to a “link” menu item (I haven’t the Pro version).
    Is there a way to disable the click by using functions.asp?
    Thanks

    • Hi Petrus,

      We’d like to take a look at your site to gain a better understanding of what’s going on. Could you please start a new forum topic and be sure to include the URL to your website. We will inspect your website and give you our best suggestions on how to solve this concern.

  2. Thank you so much — this helped a lot and worked just as easily as you described. I’m sorry I spent 30 minutes trying to figure it out myself.

  3. Thanks for a super solution to a problem I’ve been struggling with.
    It works like a dream in WP 5.5 Astra theme and means I have been able to delete the empty About and Legal pages I created to enable menu to be built, that did seem a bit of a cludge to me.
    I am very new to blogging and to WordPress and you helped me a lot here.

Leave a Reply

Your email address will not be published.