Hide the Divi Theme Header

Written by Dan Mossop

The Divi Theme comes features a prominent, responsive header bar. If you don't want to show this bar on your site, this post describes how to hide it.

Note: I've got a separate post on how to hide the top header / secondary menu bar (that's the thin bar at the very top of the page, which contains the phone, email and social icons.

Hide the Main Header using Divi Booster

You can use my plugin Divi Booster to hide it for you. Once installed, all you need to do is go to the plugin settings page, enable the "Header > Main Header > Hide header completely" option and save. The header should now be gone!

Hide the Main Header using CSS

You can alternatively completely hide it using the following CSS code:

/* Hide the header */
#main-header { display:none; }
#page-container { 
	padding-top:0px !important; 
	margin-top:-1px !important 
}

/* Adjust padding for transparent headers */
.et_transparent_nav #main-content .container {
    padding-top: 58px !important;
}

Hiding Divi's Fixed Header Only

See this post if you just want to stop the navigation bar from hovering over the page.

Hiding the Divi Header on a Single Post / Page

To remove the header from a single page (or post), you can paste the code given at the start of the post into per-page “Custom CSS” box, which you’ll find as follows:

Visual Builder – Click on the purple "…" menu button, then on the purple "cog" icon and navigate to "Advanced > Custom CSS" in the Page Settings box that appears.

Backend Builder – Click on the purple "cog" icon and navigate to "Advanced > Custom CSS" in the Page Settings box that appears.

Classic Editor – On the page edit screen, click on the three-lined “hamburger” menu button on the top right of the purple Divi Builder area. Place CSS into the Custom CSS box in the menu that appears.

CSS placed in these boxes will apply only to that particular page.

Hiding the Header on Desktops only

If you want to hide the header on desktop displays but keep the mobile header visible on mobiles / tablets, you can do so with the following CSS code:
/* Hide the header on desktop only */
@media only screen and (min-width: 981px) {
	#main-header { display:none; }
	#page-container { 
		padding-top:0px !important; 
		margin-top:-1px !important 
	}

	/* Adjust padding for transparent headers */
	.et_transparent_nav #main-content .container {
		padding-top: 58px !important;
	}
}

Take Your Divi Theme Customization Further!

Discover endless possibilities with Divi Booster. Easily hide the main header bar and unlock hundreds of additional features to customize your Divi site with ease. Perfect for anyone looking to streamline their design and functionality.

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, 

105 Comments

  1. Thanks, this was a huge help to me and worked really well.

    Reply
  2. Hi, I just copied and pasted the code in the custom css area and no change. Help!

    Reply
    • Actually, it sort of worked, but not fully. The new header didn't take the place of where the other header was and you can still see the old header, it's just smaller.

      Reply
      • Hi Margaret, I'm not sure if I'm understanding correctly / seeing what you're seeing, but at the moment I can see the header with the logo and above that is the top header with the social icons. Is this part with the social icons that you want to get rid of?

        If so, you should be able to do so with the following CSS:

        #page-container .top { display: none !important; }
        

        But please let me know if that doesn't do what you need.

        Thanks!

        Reply
  3. Complete NOOB question. Where does the code go? :0

    Reply
    • Hi Mike, there are various options, but the easiest is probably to paste it into the Custom CSS box at "Divi > Theme Options > General > Custom CSS".

      Reply
  4. How can I keep the logo and search icon intact and simply remove all navigation menus? I have tried removing them from Menu page in Wordpress but it still populates the latest pages.

    Here is my website:

    http://wordpressmu-95891-271328.cloudwaysapps.com

    Reply
    • Hi Muhammad,

      It's a bit of a tricky one. As you can see if you put an empty menu in that spot, Divi defaults to adding links to all pages not explicitly excluded in the theme options which means new pages get added. One option is to hide the navigation menus with this CSS:

      #top-menu-nav { visibility: hidden; }
      #et_mobile_nav_menu { visibility: hidden; width: 0; } 
      #et_top_search { margin-right: 0 !important; }
      

      which you can paste into "Divi > Theme Options > General > Custom CSS".

      I'd like to figure out a better way in the future (i.e. a way to stop that default behavior of adding links), but hopefully that CSS will help you in the meantime.

      Reply
  5. Thank you!

    I changed padding-top: 58px !important; to 0px coz I don't want header completely :)

    Reply
    • You're welcome, Adrian. I've just updated the code to restrict that top padding to sites that actually need it – i.e. those with transparent headers. So the full code should now work everywhere without modification. Thanks!

      Reply
  6. I've done this and removed the header. Now I want it back the way it was. How do I do it?

    Reply
    • Nevermind. I figured it out.

      Reply
  7. Hi,

    I've added the code to the CSS of the individual page that I wish to hide the menu – ours is a menu down the right side of the page and is leaving a gap i think similar to the issue Nate Heath was having. How do I fix this?
    Thanks

    Reply
    • Hi Lauren, did you try the CSS I suggested to Nate? If you're still getting the gap after adding it, are you able to send me a link to the page you're working on so that I can take a look? Thanks!

      Reply
  8. Is there a way to hide the main header on one page only? I was going to use the blank page template but I still want the footer to appear on the page. Any ideas?

    Reply
    • Hi gwhoddinott84, Divi has an option to add custom CSS to a single page. If you go to the page edit screen you should see a three-lined "hamburger" menu in the top right corner of the purple Divi Builder area. Click on this and you'll find a "Custom CSS" box. Paste the code from this post into that box and it should be applied just on that one page. Hope that helps!

      Reply
  9. Still having this issue, any thoughts?

    There seems to be some space left on posts after turning off the header and hiding #top-header, it seems fine on pages. Is there some more code that needs to be added?

    I checked CSS between a page and a post, vs. your code and didn’t see anything that would make a difference.

    http://noliftsystem.com/weighty-subject-heavy-topic

    Reply
    • Hey Nate, try adding this CSS in "Divi > Theme Options > General > Custom CSS":

      body.single #main-content .container { padding-top:0px !important }
      

      This will override the 58px padding added by my own code, which is the cause of the gap. I originally added the 58px padding to handle a case where the header has a transparent background, but I'm not sure exactly why it was necessary. When I'm less tired I'll sit down and work out why / how to get the code working in all cases :) Let me know if that extra code doesn't fix it for you. Thanks!

      Reply
      • That did it, thanks!

        Reply
  10. That work pefect ! Thanks Dan

    Reply
  11. Is there a way to hide the menu on JUST the individual post pages? I can't seem to target only the posts pages.

    Reply
    • Hi Krystal, to hide the header on all posts, and only on posts, you should be able to do:

      .single-post #main-header { display:none; }
      

      Hope that helps!

      Reply
    • Actually, is just select "Blank Page" as page template.

      Reply
      • That's a good way of doing it, Anderson. It's worth noting that this option is only available on pages (not posts) and will remove both the header and footer. Thanks!

        Reply
  12. Hi I am using divi popup modal and want to hide the page header only when the event is triggered using popup modal and unfortunately this code is not working for me any help on this is really appreciated

    Thanks

    Reply
    • Hi Ali, is there any chance you can send me a link to the page your working on, so that I can see how you have it set up at the moment? Cheers!

      Reply
      • Hi Dan,
        Thanks for your response. I am actually working on a local host at the moment. But I think I have worked it out, just by adding and extra line "#top-header { display:none; }" it's gone (it seems the secondary menu is the top header and the other is the main header). The weird thing is that secondary menu was only displaying statically on pages that did not have much content … but I think I have fixed it thanks! Regards, Ali

        Reply
        • Okay, great! Yeah, that's right, the secondary header / menu also gets called the top header and the CSS code you are using is the right thing to hide it. My code on the other hand is for hiding the main header only.

          Reply
          • There seems to be some space left on posts after turning off the header and hiding #top-header, it seems fine on pages. Is there some more code that needs to be added?

            I checked CSS between a page and a post, vs. your code and didn't see anything that would make a difference.

            http://noliftsystem.com/weighty-subject-heavy-topic

          • Hey Nate, I've just updated the code to fix this. That extra padding is only needed when transparent headers are used, and the code now checks for transparent headers before applying the padding. Thanks!

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.

Latest From Divi Booster

How to Add the Post Status in Divi's Dynamic Content

Divi's Dynamic Content feature is great for enhancing your post/page templates with post-specific information. While Divi includes an option to show information such as the Post Created Date using Dynamic Content, there is no equivalent option for the Post Status....

Fix Divi Text Module "Regular" Font Weight Not Working

Are you encountering an issue where the font weights in Divi's Text Module don't seem to apply as expected? In particular, you might find that when you set the text module's body text font weight to "Regular", your font is actually assigned a weight of 500 instead of...

Make the Divi Gallery Module Swipeable

The Divi Gallery Module comes with a slider mode that lets you display images in a slider with clickable left/right arrows to scroll through the images. For mobile / touchscreen users, you can improve the user experience by allowing your user to swipe to navigate to...

How to Use Divi Dynamic Content in Woo Modules Product Selector

Divi's Dynamic Content is a powerful feature that lets you populate your Divi modules and theme builder templates with data pulled in various sources, such as custom fields. This allows for efficient organization and maintenance of your sites.Unfortunately, Divi's...

Random Divi Posts