How to remove sidebar in WordPress from any page/post

The WordPress sidebar, or , is a space to insert widgets to the left, right, or bottom of your theme. Although very useful, sometimes you will need to remove the sidebar in WordPress because you want to have a page/post without widgets. Most modern themes have specific options in their settings panel to remove the sidebar. However, if you don’t have access to this section, this tutorial is perfect for you. We will give you 3 practical tips on how to remove the sidebar from any WordPress page/post.

How to remove WordPress sidebar completely

This first method will remove the sidebar from your theme entirely. To do this, you need to edit your theme files. We recommend that you make one and use the , otherwise you could lose all the changes made. This is because a child theme inherits all the functionality, features, and code of the parent theme without affecting the parent theme itself. Therefore, any changes made to your child theme will not overwrite the original. Also, you won’t lose any mods after theme update.

Once you’ve set up your child theme, you need to access your theme files. You can use the help of FTP clients like , open them using the file manager or go to the WordPress > Appearance > Editor. In this tutorial, we will use the first option.

Also keep in mind that your theme consists of many templates. Therefore, you will need to copy all the templates you want to edit from the parent theme to the child theme and then edit the sidebar for each template. For example, you can edit home.php, index.php, single.php, archive.php, page.phpetc.

To find the template files, go to the folder /wp-content/themes/your-theme. Choose the template you want to edit and copy it to the child theme folder. Then open the template file and look for this specific code:

Since the function of the code is to call the sidebar, you must delete the code to remove your sidebar.

See also  World Photography Day in 2022: 4 lessons from photographers on how they turned pro

Also, there is a possibility that your themes have multiple sidebars. In this case, you should look for codes that have the name “sidebar”. The code snippet below calls the footer widget:

Removing these types of codes will remove several sidebars in your template.

After completing all the steps and saving, go to your website. You will see that the sidebars are gone. However, still the images and texts will not be displayed full width. You can see that the previous sidebar dot is replaced with a blank area. This happens because your theme has a default setting for the width of the content area. To solve it you can simply add a fix page width.

How to remove the sidebar from individual WordPress pages or posts

Your website is made up of multiple pages and posts. Sometimes you may just need to remove the sidebar on a specific page and post without affecting other pages. The process is quite similar to removing the sidebar entirely from any part of your website. The difference is that you have to create a new template by copying the existing one. To make it clearer, let’s take a closer look.

Remove the sidebar from a static page

Some modern WordPress themes have provided the default full width template for a static page. Therefore, removing the sidebar from a static page is quite easy. You just need to go to the Page Attributes meta box and choose Full Width in the Template selection.

If this option does not appear, it means that the theme does not provide the full width page template. Therefore, you will need to create a new full-width template file. To do so, follow the steps below:

  1. Use any text editor and create a new file. Name this file as full-width.php and save it to your desktop.
  2. Connect your hosting account using an FTP client.
  3. Find the folder /wp-content/themes/your-theme
  4. Choose the file page.php and edit it.
  5. Copy all the code from this file and paste it into your file full-width.php.
  6. After opening the label add this text: /* Template Name: Full Width Template */
  7. still on file full-width.phpyou need to find this line
  8. The indicated code generates the sidebar on your page. Therefore, just remove it.
  9. Save the changes.
  10. Upload the file full-width.php to your child theme folder via the FTP client.
  11. Now, in WordPress, you will have the full width page template option.

Remove the sidebar from a blog page

While a static page often comes with a full-width template by default, most WordPress themes always put a sidebar on the page. To remove the sidebar from blog pages only, follow these steps below:

  1. From your WordPress dashboard, go to Settings->Read
  2. In Reading, search for the name of your blog page. Let’s say the name is “Tutorials”
  3. now go to Pages -> All Pages.
  4. Find your blog page, or “Tutorials” in this case.
  5. look for the painting page attributes and choose Full Width in the Template section.
  6. If you can’t find the Full Width option, you need to do it manually.
  7. Repeat the procedure to create the full-width page template from the previous section.

Remove the sidebar from a post in WordPress

Sometimes you may only need to remove the sidebar on a specific post. If your theme has provided you with the full-width post template, you don’t have to deal with the code. You just need to make a new post and go to the Post Attributes meta box. Choose the full width template to remove the sidebar.

But if it can’t find it, you’ll need to create a custom page template. The steps are quite similar to creating a custom page template for a static page. The only difference is that you will need to copy and edit the content of the template file single.php.

How to remove the WordPress sidebar with a plugin

If you don’t want to deal with lines of code, you can also manage your sidebar using a plugin. We recommend using this useful plugin: .

Just as its name suggests, this plugin works for any theme and page builder you might use for your website. Also, using it is extremely easy. It only takes 3 clicks to create a full width template.

Once you install and activate the plugin, you will have access to these 3 basic settings.

1. Blank template

The first setup will remove everything from your page: header, footer, sidebar, comments. All you will be left with is a blank page giving you full control over your design. This design is suitable for creating a landing page.

2. Full Width Template

The second setting will remove the sidebar, page title, and comments from the layout. Fortunately, there is no empty area left. Your content area will automatically stretch to its full width to fill the layout. The second setting is ideal if you are using a page builder.

3. No Sidebar Template

The third setting will only remove the sidebar from your layout. You can choose this if your theme doesn’t offer the No Sidebar option. The other elements and the style of the design will not be affected.

conclusion

Although a sidebar is useful for placing widgets, sometimes you need to remove it from your template for a better website appearance. We provide you with 3 practical options, choose the most suitable for your needs. Do you have any additional method to remove WordPress sidebar? Do not hesitate to share your experience with us!

Deyi is a digital marketing enthusiast, with a background in web design, content creation, copywriting, and SEO. She is part of ‘s SEO & Localization team. In her free time, she likes to develop projects, read a book or watch a good movie.

Loading Facebook Comments ...
Loading Disqus Comments ...