Beginner's Guide for WordPress / Start your WordPress Blog in minutes

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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

20 CommentsLeave a Reply

  1. Thank you so much for your extensive explanation! I just wanted to remove a widget showing on one page. And you gave me the right solution. Set your template to full with for that page.
    You made my day!
    So great that you spend a lot of time to help other people.

    • 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.

      Admin

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

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

  4. 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?

  5. 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?

  6. 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!!!

  7. 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…

  8. 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?

  9. 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.

  10. 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.

Leave A 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.