Hiding a header in WordPress can be done in multiple ways depending on your comfort level with coding and your site’s tools. Here’s a breakdown of each:
1. Using Theme Options (Beginner)
Most modern WordPress themes have built-in options to hide the header on specific pages. This is the easiest method for beginners as it doesn’t require any additional tools or coding. Astra, OceanWP, and GeneratePress are popular themes that have this option in their customizer or page-specific controls.
Step by Step:
- Go to your WordPress Dashboard.
- Go to the page you want to hide the header on.
- Look for a settings panel below or beside the content editor. In Astra this is often called Page Settings or Custom Layout.
- Find options like Hide Header, Disable Header or Page Header Settings.
- To hide the header, select a checkbox or toggle the option.
- Save or publish this page.
2. Page builders (visual and customizable)
Headers can be hidden and completely customized using page builders like Elementor, Divi, and WPBakery. These tools allow you to graphically design certain pages or components rather than writing code. If you’re using a page builder, the layout settings normally include choices for controlling header visibility.
Step by Step:
- Open the page in your page builder (such as Elementor).
- Search for Page Settings or Layout Options in the sidebar.
- Select a template that does not have a header by default, such as Canvas or Full Width.
- Or you can manually hide or toggle the header using Header Options.
- Save and preview.
3. CSS (Intermediate)
If you know a bit of code, custom CSS is a great and flexible way to hide headers on specific pages. This works regardless of your theme’s built-in options and doesn’t require any other plugins, so perfect for light customization.
Step by step:
- Find the page ID:
- Navigate to the webpage in your browser.
- Right-click and select Inspect or View Page Source.
- Locate the <body> tag and take note of the class, such as page-id-45.
- Include custom CSS:
- Go to Appearance > Customize > Additional CSS in the WordPress dashboard.
- Add this:
.page-id-45. site-header {
display: none
;}
- Replace 45 with the page ID.
- Save and refresh.
4. Plugins (User-Friendly and Quick)
Plugins provide a no-code option for hiding headers, making them ideal for newcomers or those who manage several sites. Plugins such as Hide Page and Post Header or WP Headers and Footers are specifically created for this purpose. They integrate with WordPress and have choices. Hide headers right in the page editor.
Recommended Plugins:
Hide Page and Post Header
WP Headers and Footers
Step-by-Step:
- Install a plugin: Go to Plugins > Add New, search for Hide Page and Post Header, and click Install and Activate.
- Look for a new option to hide the header. This will be a checkbox or dropdown on the sidebar.
- Click to conceal the header, then save.
- Editing theme files (for developers)
5. Editing Theme Files (For Developers)
For skilled users and developers, modifying theme files is the most effective technique to control header appearance.
This is good for complex scenarios like hiding headers based on user roles, page types, or other conditions. But requires a good understanding of PHP and WordPress template hierarchy.
Step by Step:
- Create a Child Theme:
- Copy your theme files into a child theme folder so updates don’t overwrite your changes.
- Use FTP software like FileZilla or your hosting control panel to access theme files.
- Open wp-content/themes/your-theme/header.php.
- Add conditional tags.
- Use PHP to target certain pages. For example: if (!is_page(‘contact’) { get_header();
- Replace ‘contact’ with the page slug or ID you want to hide in the header.
- Save and test thoroughly.
Leave a Reply