How to Remove Sidebar in WordPress?
Are you become confused over how to remove the Sidebar in WordPress? Not able to find the reliable solution for this?
If you want to remove the sidebar from the WordPress Site, then this article is for you.
Sometimes, you need to remove the sidebar from the WordPress Site. Maybe you need to remove sidebar from an entire sire or just from the individual pages or posts.
Purpose of Sidebar in WordPress
The purpose of sidebars is to promote things which are not the part of any post or page. Usually, sidebars contain the information about the Site, Email Subscription, Social media sharing, advertisements, google adsense and so on. Sidebars help in growing your business.
You can add the sidebars with the help of Widgets which comes with the WordPress. Usually, in WordPress themes, when seeing the site from mobile device, the sidebar appears differently. Because of the reduced screen width, these sidebars transferred at the bottom of the screen which usually appears on the left or right of the screen.
Sidebars are very helpful and help in growing business. Still, some website owners think that removing sidebar helps improve the user activity.
Removing Sidebars From Everywhere in WordPress
Do you want to remove the WordPress sidebars from an entire site?
This method lets you to easily remove sidebars from every Post or Page of your WordPress site. It requires to edit the WordPress theme files. For this, you need to edit the WordPress Theme files. Just Go to /wp-content/themes/your-current-theme/folder via FTP or FileZilla.
WordPress themes are made up of multiple templates, So you’ll need to edit all the templates which help in displaying the sidebar. Start a template file to edit it and then find the line that seems like this:
<?php get_sidebar(); ?>
If your theme has multiple sidebars, then you’ll see different instances of the same code with the sidebar name inside that function. For Example:
<?php get_sidebar('footer-widget-area'); ?>
Delete the line one by one that represents the sidebar which you do not want to show in your Website. Now, after deleting the code which is related to the sidebar, you might notice that sidebars are gone but the site content area is still appearing with an empty area.
Why this Content area appears with an empty space?
The reason is that your theme controls the width of the WordPress content area. So, after deleting the sidebar code, you need to set the width of the theme content area using Custom CSS.
First, you need to find the CSS class which is used to define the content area width. You can figure out the class using inspect engine in the browser or using the key f12.
Remove the Sidebar from Individual Pages
Do you want to remove the sidebars from the individual pages, this is also possible to display the sidebars in specific sections of the WordPress.
For Example, some websites owners display sidebar in the specific post but not on a page.
1. Edit that page from where you want to remove the sidebar and select the Full Width Template under Page Attributes meta box.
2. If you are not able to see this option to select a template, this means that your WordPress theme doesn’t support Full Width template.
3. And in this case, you’ll need to create the full-width page template separately. Just open a Plain Text Editor like notepad and Paste the below code in that file.
<?php /** Template Name: Full Width */ get_header(); ?>
4. Now save this file as full-width.php on your desktop.
5. Now Go to your called page.php file for editing and Copy everything that appears after line.
6. Now Paste that code in your full-width.php file that you make earlier. After that you need to find and Delete the following line:
<?php get_sidebar(); ?>
7. Save the changes and Upload your full-width.php file to your current theme via FTP or CPanel.
You can now edit any page on your site and you’ll be able to select the Full Width page template.
Remove the Sidebar from Blog Posts or Pages
WordPress enables you to use a separate page and a static front page for your blog pages or posts. Usually, WordPress themes display sidebars on the blog page or post.
If you don’t need to display sidebars on the blog posts then, follow this:
1. Go to Settings » Reading page.
2. Go to Pages » All Pages and Edit that page which is used to display your blog posts.
3. In the page attribute part choose the Full Width Template and then Save the changes.
Again If the Full Width template option is not there, you’ll need to create a Full Width template as I told earlier. follow the previous steps to create a Full Width file.