Hiding Divi's Secondary Menu Bar

Written by Dan Mossop

The Divi Theme's header consists of two parts: the primary menu bar, which contains the logo and main menu links, and the optional secondary menu bar, which various elements such as the email address, phone number and social network icons. If you'd like to remove the secondary menu bar, here's how to do it.

Removing the Secondary Menu Bar in the Divi Settings

There isn't an explicit option to hide the secondary menu bar in the Divi settings. Instead, the secondary menu bar will be hidden if no elements are configured to display in it. Thus, to hide it, you need to clear / disable any settings which would cause an element be added to secondary menu bar. These include:

  • Divi > Theme Customizer > Header & Navigation > Header Elements > Phone Number
  • Divi > Theme Customizer > Header & Navigation > Header Elements > Email
  • Divi > Theme Customizer > Header & Navigation > Header Elements > Show Social Icons
  • Appearance > Menus > Edit Menu > Menu Settings > Display Location > Secondary Menu

Removing the Secondary Menu Bar via CSS

If you need to, you can remove the secondary menu bar using the following CSS:

#top-header { 
	display: none !important; 
}
To remove the secondary menu bar site-wide, you can add the CSS into either the "Divi > Theme Options > General > Custom CSS" box, or into the style.css file of a child theme.

To remove the top header from a single post / page, you can instead paste this into that post / page's Custom CSS box. In the visual builder you can find this by clicking on the purple "…" menu button, then clicking on the purple "cog" icon and navigating to "Advanced > Custom CSS" in the Page Settings box that appears.

Discover Divi Booster

Divi Booster upgrades Divi with hundreds of new features to help you build awesome sites with ease.

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

12 Comments

  1. Thanks a lot.

    Reply
  2. How do I remove some but not all of the preset social media icons in the header? (I keep getting duplicates of some of them too.)

    Reply
    • Hey Michelle, go to "Divi > Theme Options > General" and if you scroll down a bit you should see options such as "Show Facebook Icon", "Show Twitter Icon", etc. You can use these to selectively disable the default social icons. Hopefully that helps with the duplicate issue too, but if you're still getting duplicates after that perhaps you can send through a link so that I can look into it for you? Cheers!

      Reply
  3. Or…go to "Appearance", "Customize", "Menus", "Secondary Menu" (or whatever you called your secondary menu), scroll down and "uncheck" "secondary menu". This will remove the menu from the top of all pages. You can then use the Divi "Menu" module to place the menu anywhere you want it.

    Reply
    • Thanks Wayne, thanks for that. Yes, that's a handy alternative to the last bullet point in the "Removing the Secondary Menu Bar in the Divi Settings" section. Either should remove the menu from the menu bar and as you say you can then use the Menu module to relocate this elsewhere. Cheers! Dan

      Reply
  4. Beautiful. Thank you much! I needed to hide it on all pages, except the homepage. This did the trick.

    Reply
    • Great! I'm glad it helped, Ryan.

      Reply
  5. Thanks. I am fixing up a friend's site who owns a business. Your post helped.

    I can get a little obsessive. The code works but for a quarter of a second when I go to the page where I entered your code to exclude the top bar shows up and then disappears. Is there any way to fix this so the bar doesn't appear at all for the excluded page?

    Reply
    • Hi Harland, this would suggest your CSS isn't being added early enough in the page. If you're adding it in a code module on the page, try moving it into the per-page Custom CSS box (found in the Divi Builder menu / settings for the page). If that doesn't work, you may need to add the CSS globally using something like the "Divi > Theme Options > General > Custom CSS" box or a child theme's style.css, and restrict it to your target page by changing the CSS to something like:

      body.page-id-1234 #top-header { 
          display: none !important; 
      }
      

      (Replacing "1234" with the ID of your page, found in the URL of the page when you're editing it).

      I hope that helps, but if not, perhaps you can send me a link to the site and I'll see if I can suggest something that will. Thanks!

      Reply
  6. This removes the secondary menu but not the space it occupied. My main menu simply snapped to the top of the page and left a white space below. I can't find how to remove that whitespace, is it a margin of the main-menu? In developer tools I can't find any element or css style that causes that whitespace.

    Reply
    • Found it: a wrong setting for the Jumping Header Fix caused it (I had to change 89px to 62px).
      /* Jumpy Header Fix */
      #page-container {
      top: 89px !important;
      padding-top: 89px !important;
      }
      Clearing all Divi settings for the secondary menu bar hides it perfectly well.

      Reply
      • Great! I'm glad you figured it out, Boris, and thanks for the update.

        Reply

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

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

We may earn a commission when you visit links on our website.