How to hide the header and footer on the Odoo website?

Effortless Ways to Conceal the Header and Footer on Your Odoo Website
August 26, 2023 by
Seyed Ali

For Odoo new versions

We have a default Odoo feature to hide the header and footer for Odoo new versions.

There are 3 simple steps to hide the header and footer from your website.

To hide the header:

Step 1: 
Open edit mode

Open edit mode in odoo website

Step 2: 
Click header

Click header in the Odoo website

Step 3: 
Choose Header Position -> Hidden

Hide header in odoo website

To hide Footer:

Step 1: 
Open editor mode

Step 2: 
Click the footer

Step 3: 
Disable Page Visibility

Disable footer page visibility in odoo website

For Odoo Old Versions

Odoo older version doesn't has the Header position and Page visibility option. So we need to execute a Java script to hide the header and footer.

Step 1: 
Open Site -> HTML/CSS Editor

Open HTML & CSS editor in odoo website

Step 2: 
Choose JS

Open JS editor in odoo website

Step 3: 
Copy and paste the below mentioned code in the JS file and add your url which you want to hide the header and footer in the /example-url

For example:
I want to hide the header and footer for page URL is landing-page-header-footer-hided. So I changes the URL
/example-url -> /landing-page-header-footer-hided
$(document).ready(function() {
var currentUrl = window.location.pathname;

if (currentUrl === '/example-url') {
$("header").hide();
$("footer").hide();
}
});

Edit JS code in Odoo website

Save the file

If you want to hide the header and footer for more than one pages, then proceed with step 4.


Step 4

Add 2 vertical bars "||" in between 2 URLs which you want to hide the header and footer like below.

$(document).ready(function() {
var currentUrl = window.location.pathname;

if (currentUrl === '/example-url-1' || '/example-url-2') {
$("header").hide();
$("footer").hide();
}
});


I hope this blog helps you to hide the header and footer in the website,
Thank you.


Seyed Ali August 26, 2023
Share this post
Archive