Hiding Divi's Secondary Menu Bar

This post may contain referral links which may earn a commission for this site

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 Options > Header & Navigation > Header Elements > Phone Number
  • Divi > Theme Options > Header & Navigation > Header Elements > Email
  • Divi > Theme Options > 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.

Hundreds of new features for Divi
in one easy-to-use plugin

7 Comments

  1. 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
  2. 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
  3. 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

Leave a Reply to Harland Cancel reply

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