If you are looking for the easiest methods to remove Sidebar from the pages/post of your WordPress website, you are at the right place. We are going to tell you about how you can remove the sidebar from your posts and pages on your WordPress website.
Sidebars take a lot of extra free space if you are not using many widgets or plugins. You can simply devote this free space to the article. By the end of this article, you will have enough methods to remove the sidebar from your posts and pages in your WordPress website.
Before we begin, it is recommended to take the complete backup of your website. To do so, Install any backup software like All In One WP Migration. Activate and then download the latest backup of your WordPress website.
We assume that you are having the child theme active so that the changes won’t reflect in the parent theme. You need to access the File Manager of your hosting.
Either you can use the FTP clients like Filezilla or directly open the File Manager from cPanel of your hosting. You can even use the Editor from WordPress dashboard if you have the access to that.
- Once you have access to the files of your WordPress website, you need to navigate to the theme files.
- To navigate to the template files, follow a similar path in the file manager of your Website. Firstly, go to public_html.
- Then, navigate to the “wp-content” folder and open the “themes” folder.
- Select the current theme on your website. Select the template from where you would like to remove the sidebar & copy it to your Child-Theme folder.
- Now, open the template from the child theme folder and look for the code in your file.
<?php get_sidebar(); ?>
- This is the code that is calling the sidebar function, you will have to remove the code in order to remove the sidebar from the template.
- However, your theme might have defined multiple sidebars. You will have to find the codes with the keyword “sidebar” in them. Additionally, you can remove the footer widgets by removing the code which looks like:
<?php get_sidebar('footer-widget-area'); ?>
- Look for any additional code which has ‘sidebar’ in it and remove it. In this way, you will be able to remove the sidebar from the particular template in your child theme.
- Publish the changes by saving the files. This will remove the sidebar widgets from the template which you have edited.
However, this will not align the body content in the center, as you just have deleted the commands which call the sidebar function in the template. You will see a blank space in the place of your sidebar in the template which you have already edited.
You might want to remove the sidebar from only a few pages or posts on your website, the above method won’t work in that case. You will have to do a bit of a similar task for removing the sidebar from individual posts and pages.
Firstly, you need to decide whether you would like to remove the sidebar from a static page or the blog page. As there are two ways you can remove the sidebar individually, choose with the one you want to proceed.
If you want to remove the sidebar from your static page, this is the one to follow. There are some themes that have a template for pages & posts without the sidebar. You can see the option from the settings in your page/post editor as Template under Page Attributes.
You can create a Full-Width template of your Static Page/Post. In order to remove the sidebar from Static Page in your WordPress website, follow the below method:
- Open any text editor of your choice and create a new file with the name as full-width.php. Save this file at an easy-to-find location (We will need to access it again)
- Open the FTP client of your Hosting, you can choose Filezilla if you don’t know much about these. You can even open the file manager from the cPanel of your hosting plan.
- Navigate to /wp-content/themes/ and open the currently active theme’s folder.
- Select the page.php file and open it to edit.
- Now, Copy the whole code from the file and paste it in the recently created full-width.php file on your local system.
- In the local file, add this comment after opening <?php tag, for easy identification
/* Template Name: Full Width Template */
- Now, you need to look for the code that calls the sidebar function. From the full-width.php file on your system, look for the code as:
<?php get_sidebar(); ?>
- Once you are successful in finding the line of code, delete it in order to remove the sidebar from this template. Look for another line that has ‘sidebar’ and remove it if possible.
- Save the file after making these changes.
- Now, you need to upload this full-width.php file to the child theme folder. You can use the FTP clients or complete the task using File Manager on cPanel.
- After successfully uploading the full-width.php file, you will see an option of Full Width in the Templates option. You can select the Full-Width template whenever you want to remove the sidebar from a single page/post.
If you are looking forward to removing the sidebar from your blog page, you need to follow this method. You can also check if your blog page has any layout/template like no sidebar or full width, etc. Otherwise, follow the steps below to remove the sidebar from a blog page individually.
- Open the WordPress dashboard of your Website
- Navigate to the Settings > Reading
- You will see the name of your website under the Reading section.
- From there, go to Pages > All Pages
- Look for the name of your Blog.
- Locate the Page Attribute Box and then select the Full Width from the template section
- If you cannot see the full-width template there as well, you will need to create a new template.
- Copy the same process to make a full-width template and upload it in the Child Theme, just like we did in the last process.
- Once you see the full-width template, select it and you get to see the blog page without the sidebar.
You might only want to remove the sidebar from a single post on your WordPress website. There are instances when you are writing a blog post and you just need to remove the sidebar from the post.
As we have already mentioned earlier, you can use the full width template if your theme provides it. Create a new post or edit the existing post from where you want to remove the sidebar.
If your theme doesn’t provide any full-width template, you will need to create a new template.
- In order to create the template, you need to copy the code from single.php this time.
- Paste it in a file named single-full-width.php locally.
- Make the edits that were made previously like removing the sidebar code and adding the comment.
- Once, you are done editing the single-full-width.php file, save it.
- Now, upload the file in your Child Theme using FTP Clients or File Manager.
Now, you will see the option for the Full-Width template in your blog posts as well. You can select the full-width template in your post and enjoy the individual post without sidebar.
If you are not into coding or you don’t want to do extra work, you can also go for the plugins. If you don’t have access to the FTP server or cPanel, you can prefer using this method. Plugins come handy when you just want to automate things or you don’t have access to the FTP server or File Manager.
All you need is a single plugin that will create the templates for you & you won’t have to do any manual task. It will automatically arrange everything & the sidebars will be removed from the templates you want.
- To Use Plugin for removing the sidebar from your pages/posts, follow these steps:
- Go to your WordPress Dashboard
- Click on Plugins and then click on Add New Plugin
- Now, Search for “Fullwidth Templates for Any Theme & Page Builder” plugin by Brainstorm Force.
- Install the plugin and then activate it.
- Now, Open the Page or Post from where you would like to remove the sidebar.
- You must see the settings from the plugin or the option for the No Sidebar template in your WordPress editor. Save the changes after using the No Sidebar template & you are good to go.
There are three templates with this plugin. We would like to give you a brief about all of them so, you can easily choose the right one. Here are the three types of template in this plugin:
As the name suggests, it is the blank template. This will have nothing at all. It will remove everything from your page, including Header, Footer, Widgets, Sidebar, Comments, etc. All you have is the body content of your page/post.
This is the Full Width template without any sidebar, comments, etc. This is the template where you can utilize the content area. It will not have any extra spacious elements from your page/post. It will give the complete width of the page to your content only.
The last one might be the one you are looking forward to using on the page or post of your WordPress website. This is the template that will remove the sidebar from your page/post on your website. However, it will not make any changes to the rest of the things.
That was all about how to remove the sidebar from the pages/post on your WordPress website. If you are having any better methods to remove the sidebar from a WordPress website, let us know through the comments.
If you are facing any trouble or have any queries, let us know through the comment box and we would love to resolve them. If you were successful in removing the sidebar from your page/post, share your experience about the method which worked for you.
Have a Great Day😊!!