Sidebar is a useful feature to WordPress website owners and visitors alike. It aids navigation and marketing, as it usually contains useful shortcuts to various areas of the site or a list of most recent or most popular posts or pages. In many cases, it’s also a way to show advertisements, set up a mailing list form, or display pictures/videos unobtrusively. However, it prevents you from utilizing the full width of the page. Additionally, it may be entirely unnecessary, especially when creating a landing page or a one-page website. If that’s the case, knowing how to remove sidebar in WordPress is crucial. Let’s begin.
1. Change page layout within WordPress theme settings
All high-quality WordPress themes, free or paid, are built for versatility. In other words, they know different users require varying page layouts and that one website can use multiple, depending on the content. Here’s are a few examples of that:
WordPress Theme Settings
Access your WordPress Admin Section, then expand the left sidebar. Look for any mention of your active theme name in the options. If there are none, head over to Appearance before selecting Themes. Find yours on the list, and look for “Options” or “Configuration or “Settings” links below. If such an option exists, look for the setting that has to do with Sidebars. In many cases, it’s a separate menu item.
Did you notice the sidebar only appears on the posts and lists the most recent things you published? Here’s one option you may find:
- Instead of “Appearance”, go to Settings.
- Select Reading.
- Find an option titled Your homepage displays.
- Set it to “A static page”.
- Instead of whichever type of page your Posts section is set, pick a different template from the drop-down list. If your homepage has no sidebars, choose the same template it uses.
On-page Theme Settings
Start editing any post or page, whether in Classic Editor or Block Editor. Now:
- For the former, look at the boxes on the side and below your post. For the latter, expand the list of options on the side, and ensure you’re in the Document tab.
- Look for the same as above a box/menu entry titled “<Theme name> Settings” or “<Theme name> Options”.
To give you an example, the Astra theme has an Astra Settings option in both Editors. Among sections you can disable, it offers an option titled Sidebar, under which you can select No Sidebar.
Page Attributes
Don’t quit the Editor just yet. This time, look for options titled Template, Page Attributes, Attributes, Page Layout, or Layout. If you can find it, ensure you select anything that mentions “Full width”. If you can’t find a template, you can manually create one without a sidebar while preserving all other page elements. Start by creating a new plain text file document. Open it in a text editor such as Notepad, and enter:
<?php
/*
*
Template Name: Full Width
*/
get_header(); ?>
Continue by saving the document and naming it full-width.php. Make sure to change the “Save as type” to All files before entering the file extension. Then:
- Access your WordPress website via FTP.
- Head over to “wp-content/themes/name-of-your-theme/” before right-clicking on the page.php file.
- Select View/Edit, then highlight the entirety of the code after
<?php get_header(); ?>
(excluding that line). - Open full-width.php and paste the code below the last line.
- Find this line in code:
<?php get_sidebar(); ?>
and delete it. It’s what makes sidebars appear. - Save changes, and upload your file to the ~/name-of-your-theme/ folder.
- Start editing your page or post in WordPress and look for the “Full Width” template.
WordPress Live Preview
Another way to remove the sidebar in WordPress is via the Live Preview feature built into the CMS (Content Management System). To get there, do one of the following:
- Access the page on which you want to get rid of a sidebar. Make sure you’re logged in to WordPress. Click on the Customize link in the top bar.
- From the WordPress Admin dashboard, open the left sidebar, then click on Appearance > Customize.
You’ll now see a list of options on the left-hand side. Look through them for the words we mentioned above.
2. Remove a sidebar completely via WordPress widgets
The methods above work when you want to remove the sidebar on certain posts and pages in WordPress. In contrast, removing sidebars altogether from the Widgets tab in WordPress works like this:
- Expand the sidebar on the left-hand side of the WordPress Admin dashboard.
- Go to Appearance, then choose Widgets.
- Locate the Sidebar area, and take note of all widgets.
- Click on the downward-facing arrow next to the widget’s name or type.
- When it expands, do a quick preview to double-check those are widgets you want to erase.
- Click the Delete link in the bottom left corner.
- Repeat steps 4, 5, and 6 for all sidebar widgets.
3. Get rid of sidebars by editing theme files
Decided to eradicate sidebars from all parts of your website? If you’re sure you won’t need it, the procedure is similar to the template one we mentioned above:
- Gain access to your website files via FTP.
- Go to “wp-content/themes/name-of-your-theme/”.
- Open page.php and use Ctrl (Control) + F or Command + F on Macs to open a search bar.
- Find the following line and delete it:
<?php get_sidebar(); ?>
- Search for “sidebar” and look for any instances. As with widgets, sidebars can exist in multiple places. Delete any lines that start and end the same, such as:
<?php get_sidebar('footer-section'); ?>
. - Check other PHP files (index.php, single.php, home.php, archive.php, and so forth) for mentions of lines in step 4, and erase them.
Sidebars are gone, but the area is empty. What now?
Unlike widgets, your theme won’t automatically adjust to the changes you made. Instead, you must edit CSS. While you can edit your theme files, a safer way is to install a WordPress plugin. Although we’re not affiliated, a lightweight example is:
Then, open your website frontend in Google Chrome, right-click, and select Inspect. Look at the Styles tab in the bottom portion on the right-hand side for an element that lets you set page width. A commonly quoted example is:
.content-area {
width: 100%;
margin: 0px;
border: 0px;
padding: 0px;
}
margin:0px;
}
4. Removing sidebar using a WordPress plugin
Installing a WordPress plugin is yet again a valuable solution. It can help you in the absence of theme options and knowledge of CSS or the presence of fear to edit your website source code. Although there are numerous plugins that can do this, one that focuses on this specific functionality is the following one: