WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Themes» How to Remove the Sidebar in WordPress

How to Remove the Sidebar in WordPress

Last updated on December 10th, 2020 by Editorial Staff
170 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Remove the Sidebar in WordPress

Do you want to remove the sidebar from your WordPress site? The sidebar is a widget-ready area in your WordPress theme.

It often appears on the right or left side on every page.

In this article, we will show you how to easily remove the sidebar in WordPress.

How to Remove the Sidebar in WordPress

Why Remove the Sidebar in WordPress?

Most free and paid WordPress themes come with multiple sidebars or widget-ready areas.

The purpose of sidebars in WordPress is to display items that are not part of the post or page content. Usually, these are links to different areas of your website, advertisements, email list signup forms, social media profiles, or any other links you want people to see.

These items can be easily added to the sidebar of a theme using WordPress widgets.

Sidebar on a WordPress powered website

In most WordPress themes, the sidebar appears differently when a user is viewing your site from a mobile device. Due to the reduced width of the screen size, sidebars that appear on right or left on the desktop are moved to the bottom on mobile screens.

Sidebars are immensely helpful and can help you grow your business. See these WordPress sidebar tricks for maximum results.

However, some website owners feel that removing the sidebar helps improve user experience. If you’re looking to remove the sidebar on your WordPress site, then this tutorial is for you.

Video Tutorial

Subscribe to WPBeginner

If you don’t like the video or need more instructions, then continue reading.

Removing Sidebars Using Your WordPress Theme Settings

Many of the best WordPress themes come with built-in settings to remove sidebars. Depending on your theme, you can remove them site-wide, or simply remove them from individual posts or pages.

You can find out if your theme has this option by editing a single post or page.

In the right column, you will be able to see the option to remove sidebars. For instance, here is what you would see if you were using the Astra WordPress theme.

Removing sidebar using theme settings

Some themes may have an option to choose a single post or page template including a full-width template. You will find the option to select the template under page attributes section on the right column.

Full width page template

Some themes would also allow you to select a sidebar layout from theme options. You can find these options under Appearance » Customize page.

Removing WordPress sidebar using theme settings

Depending on your theme, the location and appearance of these options may vary. Once you have located the settings, you will be able to instantly see your changes appear in the live preview.

Don’t forget to publish your changes before exiting theme customizer.

Keep in mind that some WordPress themes may not have this feature at all. In that case, continue reading and we’ll show you other ways to remove the sidebar in WordPress.

Removing Sidebars From Everywhere in WordPress

This method allows you to simply remove sidebars from every page and post on your WordPress site. It also requires you to edit WordPress theme files. So, if you haven’t done this before, see our guide on how to copy and paste code in WordPress.

Keeping in mind that if you edit your WordPress theme files directly, then those changes will disappear when you update your theme. This is why you would need to create a child theme to save your changes.

First, you need to connect to your WordPress site using an FTP client and then go to /wp-content/themes/your-current-theme/ folder.

WordPress themes are made up of different templates, so you will need to edit all the templates where a sidebar is displayed. To locate the file, see our guide to WordPress template hierarchy.

For example, in a typical WordPress theme, you may need to edit index.php, page.php, single.php, archive.php, home.php and so on.

Open a template file to edit it and then locate the line that looks like this:

<?php get_sidebar(); ?>

If your theme comes with multiple sidebars, then you will see different instances of this code with a sidebar name inside the function. For example:

<?php get_sidebar('footer-widget-area'); ?>

Delete the line that represents the sidebar that you don’t want to display.

Now, save and upload the file back to your WordPress hosting account. Repeat the process for all template files responsible for displaying different pages on your website.

Once finished, you can go to your website and see it in action.

You may notice that while the sidebars are gone, your content area is still showing up with the same width, leaving the sidebar area empty.

Blank sidebar area in a WordPress theme

That’s because your theme has a defined width for the content area. Now that the sidebar is gone, you need to adjust the width of the content area by adding custom CSS to your theme.

First, you will need to figure out the CSS class used by your theme to define the width of the content area. You can do that by using the Inspect tool in your browser.

Here’s the sample CSS we used on our demo site using the Twenty Sixteen theme.

.content-area {
    width: 100%;
    margin: 0px;
    border: 0px;
    padding: 0px;
}

.content-area .site {
margin:0px;
}

Here’s how it looks without sidebars:

Sidebars removed from a WordPress theme

Removing Sidebars From Individual Pages in WordPress

It’s possible that you only want to remove the sidebars on certain pages while displaying them on other sections of your website.

For example, a lot of websites display sidebars on their blog page but not on individual blog posts. Some prefer to show sidebars everywhere except static pages.

If you’re looking to create a custom landing page or sales page, then we recommend using a WordPress landing page plugin like SeedProd because it lets you create custom landing pages without writing any code (using a drag & drop interface).

Having that said, let’s take a look at different scenarios and how to remove sidebars from different areas.

Removing Sidebars from a Static Page in WordPress

As we mentioned earlier, many WordPress themes come with ready-to-use full-width page templates. These templates can be used with any static page in WordPress and do not display sidebars on either side of the content.

You will just need to edit the page where you want to remove the sidebar and then select the full-width template under ‘Page Attributes’ meta box.

Full width page template

If you do not see an option to select a template, then this means that your theme does not come with a full-width page template.

In that case, you will need to create a full-width page template manually. Open a plain text editor like Notepad and paste the following code in a blank file:

<?php
/*
*
Template Name: Full-Width
*/
get_header(); ?>

Now save this file as full-width.php on your desktop.

Connect to your WordPress site using an FTP client and then go to /wp-content/themes/your-current-theme/ folder. Edit the file called page.php and copy every thing that appears after <?php get_header(); ?> line.

Now paste this code in your full-width.php file. After that you need to locate and delete the line that looks like this:

<?php get_sidebar(); ?>

Save your changes and upload the full-width.php file to your current theme folder.

You can now edit any page on your WordPress site and you will be able to select your full-width page template.

For more details, see our guide on how to create a full width page template in WordPress.

Remove the Sidebar from a Single Post in WordPress

Just like pages, WordPress also comes with built-in support for post templates.

If you want to remove the sidebar from certain single posts, then you can create a custom single post template. It is similar to creating a full-width page template.

First, you’ll need to create a new template file using a text editor like Notepad. Next, you need to copy and paste the following code in that file:

<?php
/*
 * Template Name: Featured Article
 * Template Post Type: post, page, product
 */
  
 get_header();  ?>

This code defines a new template called Featured Article and makes it available for post, page, and product post types.

You can save this file as wpb-single-post.php on your desktop.

Next, you need to upload it to your current WordPress theme folder using an FTP client.

You can now edit any single post on your website and you will notice the new Post Attributes meta box with an option to select the template.

Single post template

You can follow the steps outlined in our guide on how to create custom single post templates in WordPress.

In your custom single post template, all you need to do is make sure to remove the sidebar part of the code.

If you want more control over your site’s layout, there are some great page builders available.

Remove Sidebars using a Page Builder Plugin

If you only want to remove sidebars from a few pages, then you can use a WordPress page builder plugin like Beaver Builder or Divi.

These drag and drop page builders come with ready to use templates that you can use to create custom page layouts. You can also use a blank template and design one from scratch.

For the sake of this tutorial we’ll be using Beaver Builder but it is pretty much the same with most page builders.

First, you need to install and activate the Beaver Builder plugin. For a step-by-step tutorial, see our guide on how to install a WordPress plugin.

Upon activation, simply edit the post or page that you want to edit and on launch the Beaver Builder editor.

Launch Beaver Builder

Beaver Builder comes with several templates that you can use. You can also make your own layout by simply adding modules, rows, and elements to your page.

Choose a template

For more detailed instructions, see our tutorial on how to create custom WordPress layouts with Beaver Builder.

We hope this article helped you learn how to easily remove the sidebar in your WordPress theme. You may also want to see our step by step guide on how to boost WordPress speed and performance, and our comparison of the best email marketing services to grow your traffic & sales.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

170 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • How to Fix the Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

18 Comments

Leave a Reply
  1. frespaniol says:
    Aug 10, 2020 at 5:44 pm

    I tried it with Twenty Sixteen theme, but it doesn’t work.. is it normal..?

    Reply
    • WPBeginner Support says:
      Aug 11, 2020 at 10:41 am

      The theme may have a different location where it is adding the sidebar. If you reach out to the theme’s support they can normally let you know where the code for the sidebar is added.

      Reply
  2. Stacey Beckles says:
    Jun 15, 2020 at 1:55 am

    Your posts are always a lifesaver.

    Reply
    • WPBeginner Support says:
      Jun 16, 2020 at 8:49 am

      Glad you find them helpful :)

      Reply
  3. Gary says:
    Dec 22, 2018 at 3:24 am

    Can the users just switch the toggle on the front-end to show or hide the sidebar themselves?

    Reply
  4. Sergio says:
    Dec 20, 2018 at 11:08 pm

    Thank you!

    Reply
  5. Eray says:
    Sep 12, 2018 at 3:50 am

    Is there a way to disable sidebar on mobile? I have a responsive theme and on mobile it naturally shapes itself. But when I scroll down, I see the sidebar “latest articles” widget there.
    On desktop view,it’s OK, but on mobile it displays other blocks, which are sufficient but then also sidebars. Can I disable it for mobiles? Thank you.

    Reply
  6. Hussain says:
    Aug 13, 2018 at 11:01 am

    Yet Another clear and useful post . thank very much.

    I have two questions:

    1-The theme I am using, namely oceanwp, has the option to remove the sidebar but simply does not work. What is the possible reason?
    1- I managed to remove the sidebar using the index.php file. If there is update for the theme. Is the change reversible?

    Regards

    Reply
  7. Max says:
    Jul 26, 2018 at 10:22 am

    Is there are way to remove sidebar/footer using hooks? E.g. using remove_action();?

    Reply
  8. Steff says:
    Apr 13, 2018 at 12:21 pm

    You’re an absolute legend!

    :)

    Reply
  9. David Riewe says:
    Apr 9, 2018 at 10:23 am

    The custom template does remove the sidebar but is not using the full width.

    Reply
  10. Patricia says:
    Mar 19, 2018 at 11:30 am

    Kindly help me out? I’m trying to remove the sidebar from all pages but the index.php. Following these instructions works beautifully but changing the content-area width to 100% pushes the sidebar to the bottom of the index.php. How do I exclude the index.php from the change of the content-area width?

    Reply
  11. Girik says:
    Feb 20, 2018 at 11:08 pm

    HI Team

    I am looking for a solution to remove the sidebar from home page where the home page is set to latest post. Do you have?

    Reply
  12. Susan Taunton says:
    Dec 6, 2017 at 4:19 pm

    I love your video tutorials – they are always crystal clear and informative. And your topics are so often precisely relevant to my needs. Thank you!!

    VIva la WPBeginner!!!

    Reply
  13. Mateo says:
    Nov 29, 2017 at 10:10 pm

    I have a problem, i want set full width, but when I do it, my home is too in fullwidth (surely because i dont use excerpt, else that i use the_content() for get the content in home page).. how can I do a fullwidth with this problem…

    Reply
  14. Linda says:
    Aug 27, 2017 at 12:01 pm

    Thank you so much for helping me get rid of the right bar. But now I can’t show my blog in full frame. It is namned “home” in the meny, but does´nt exist when I´m scrolling in “sides” like you show here. Can you help me fix it in the code?

    Reply
  15. katma says:
    Aug 2, 2017 at 3:52 pm

    That’s what i am looking for!!!
    But the problem is finding the CSS class.

    I tried with css hero. I could find the css class name but i couldn’t make it with the adding custom CSS function.

    Even i can optimize the with for phone, tablet vertical and horizontal position and pc.

    Reply
  16. Terry says:
    May 17, 2017 at 4:55 pm

    Instead of deleting the code, it is safer and recommended to comment it out.

    Add the following // in front of every instance of the get sidebar call and the sidebars will stop displaying without disrupting the code.

    Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
PushEngage
PushEngage
Increase your website traffic & revenue with push notifications. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2021 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2021)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2021)
    • SiteGround Reviews from 4464 Users & Our Experts (2021)
    • Bluehost Review from Real Users + Performance Stats (2021)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2021 – Step by Step Guide
Deals & Coupons (view all)
LiveChat logo
LiveChat Inc Coupon
Get a 30 day free trial and 30% OFF LiveChat, one of the best live chat service providers for WordPress users.
LearnDash
LearnDash Coupon
Get the lowest price on the best learning management system (LMS) plugin for WordPress.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
  • Growth Fund
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon
  • AIOSEO

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress Security by Sucuri.