WordPress | Remove Sidebar | From Entire Site Or Individual Pages

WordPress | Remove Sidebar | From Entire Site Or Individual Pages

Sometimes you just want to get rid of the sidebar in your WordPress theme. You can wish to remove the sidebar from the entire site or just specific topics or pages. Whatever the cause for your dissatisfaction with it, there is always a solution to customize your website to your liking.

Your site widgets places in a sidebar space. The most common placement is on the right, but it can also be on the left or below the content area.

Most WordPress themes, both free and premium, include several sidebars or widget-ready spaces. Sidebars are useful and can aid in the growth of your company. You may even make your own WooCommerce or WordPress sidebar.

It might include information about the website, a contact form, relevant content, adverts, signup forms for email lists, social network accounts, and more. There are numerous options.

In WordPress, sidebars are used to display elements that aren’t part of the main body of a post or page. WordPress widgets make it simple to add items to a theme’s sidebar.

When a visitor views the site on a mobile device, the sidebar will display differently in most WordPress themes. On mobile screens, sidebars that show on the right or left on desktop screens relocate to the bottom due to the smaller width of the screen.

Although a sidebar can be handy, it always requires. Website owners may find them to be more of a nuisance than a useful tool at times.

Sometimes you’ll find that a single column is better for a complete site or just a single page. With that in mind, I’ll go over how to remove the sidebar from your WordPress theme in this piece.

WordPress Methods Removed from the Sidebar

Why would you want to remove the sidebar from your WordPress site? Remove the sidebar if you want your site visitors to be able to read your blog material without being distracted. On mobile devices, the sidebar may not look as it should. Whatever the reason, it must remove.

Most themes provide you the option of not displaying the sidebar or limiting it to specific pages or posts. You can also contact the theme author, who will be able to inform you how to remove it from WordPress.

If you can’t contact support and your theme doesn’t provide a sidebar removal option, you can use one of the techniques listed below, depending on what you want to do with the sidebar.

The first thing to think about is where you want to get rid of the it. Is it possible to get a specific page template? From the entire website? Only static pages?

#1. Is it possible to remove the WordPress sidebar from the entire site?

Do you want your WordPress website’s sidebar to be removed from every page and post? You’ll need to edit WordPress theme files to accomplish this.

Using FTP (for example, FileZilla) or cPanel, navigate to the /wp-content/themes/your-theme-name/ folder (if your hosting uses it). You may also edit theme files in your site dashboard by navigating to Appearance – > Editor.

WordPress theme files are made up of templates. You need to edit  the template that displays the sidebar you want to delete. To display the sidebar, you need to edit index.php, archive.php, page.php, single.php, home.php, etc.

 You should look for a line in the template file that looks  like this:

 & lt ;? php get_sidebar () ;? & Gt;

This code is used by WordPress  to add a sidebar to a particular page. Deleting that line deletes the sidebar.

 If your theme contains multiple sidebars, you’ll see different instances of this code with the sidebar name inside the function. Example:

 & lt ;? php get_sidebar (`footer-widget-area’) ;? & Gt;

 Delete the line that represents the sidebar  you don’t want to see.

 You may notice that the content area is displayed the same width and the sidebar area is left empty even if the sidebar disappears. The sidebar may be gone, but  you may not have used the full width of your site yet.

Instead, the content is probably the same size as before, just next to the empty space where the sidebar was.

 This is because the width of the content area is controlled by the theme stylesheet. Read the steps below to find out how to fix this.

 # 2. How do I remove the sidebar from individual pages?  What if I want to remove the sidebar from an individual  WordPress page, but want it to be visible in other areas of the site? Most WordPress themes come with ready-to-use full-width templates. You can use these templates  on any page.

 Go to the page where you want to remove the sidebar and select the Full Width template under the Page Attributes metafield to remove the sidebar for that particular page.

But what if the WordPress theme doesn’t have a full width template? In that case, the template does not have a “Full Width” option, as shown in the image above.

 You need to manually create the full width template. Open a simple text editor like Notepad and paste the following code into an empty file:

 & lt ;? php

 / *


 Template name: Full width

 * /

 get_header () ;? & Gt;

 Save this file as full-width.php on your desktop. Then open the page.php file from the theme file and & lt ;? You need to copy everything that follows php get_header () ;. ?? & Gt; line. Add this code to the full-width.php file after the

 get_header part. Then you need to find and delete the following line:

 & lt ;? php get_sidebar () ;? & Gt;

 If the theme doesn’t show the sidebar on the page, the code isn’t in the file. Save your changes and upload the full-width.php file to your current theme folder via FTP or cPanel.

You can now edit any page on your WordPress site to select a full-width page template. If you don’t have a template under Page Attributes on your page, you have one. Note that  changes made to the parent theme may disappear when the

 theme updates. Always use child themes for  customization.

 # 3. How do I remove the WordPress sidebar from my blog post page?  Most WordPress themes display a sidebar on your blog post page. Apart from the static home page, WordPress allows you to use a separate page for your blog post.

 What if I don’t want the sidebar to appear on my blog post page? WordPress allows you to create static homepages and  separate pages for  blog posts.

 If you don’t want the sidebar to appear on your blog post page,  you need to go to Settings »Browsing Page. Note the name of the page you are using as your blog post page.

Then go to Pages »All Pages and edit the page where your blog post will appear. In the Page Attributes section, select a full-width template to save your changes.

 If you don’t see the full-width template option, you’ll need to manually create the full-width template. See the previous section of this article for detailed steps.

 # 4. How do I disable the sidebar for a particular post? If you want to remove the sidebar for a particular post, you can use the Display Widgets SEO Plus plugin.

 This plugin has the option to hide the widget and hide the sidebar for certain posts. Simply enter the post ID from a post that hides the sidebar and it will be removed from that post. If you don’t know how to find your ID,  you can read my post explaining how to find your WordPress site ID. The

 post is displayed in full width without any additional adjustments. See below for more information on how the plugin works.

Remove  WordPress methods in the sidebar using a plugin

 With the Display Widgets SEO Plus plugin, you can hide the sidebar for specific categories, selected content types and custom post types, specific static pages, custom post type archives, custom classification archives, and specific posts throughout your site. Can be displayed or displayed.

 Show Widgets  When the SEOPlus plugin is active, you can show or hide widgets using dropdown selections and checkboxes (added at the bottom of the widget under View> Widgets). increase. The

 plugin works with custom classifications, custom post types, custom post type archives, and the WPML language plugins bbPress and BuddyPress.

For example, you can use this plugin to specify that the widget  only loads on certain categories of posts  and some selected static pages,  404 error pages, and homepages. After installing and activating the

 plugin, you will see new options under each widget under Appearance-> Widgets in the sidebar.

 If desired, choose to hide  each widget in the sidebar to hide the sidebar. In most cases, the page will not leave any empty space where the sidebar was. It is stretched to the full width.

Removed sidebar, but there is a blank area where Sidebar was

 You may need to make some additions to your stylesheet to convert your site to full width. If you completely remove it from the entire site, you only have to edit the existing style.

 However, if some pages  still show the sidebar, you need to keep the current style and  add new styles to increase the width as needed.

 Use the Inspection tool (right-click and select Inspection on the inspection page) to identify the style that needs to be adjusted. We need to identify this container because we want to find the width of the entire layout. You can also use WordPress CSS editor plugins such as

CSSHero and Microthemer. Remove the sidebar using page builders such as Elementor (see Differences between Elementor Free and Pro), Visual Composer, Beaver Builder, Divi (see Divi and Beaver Builder), Oxygen, Brizy, and other CSS editing tools. You can also customize it. Edit the stylesheet from the WordPress site or after removing the sidebar.

LadiTech web designing

For website emergency help, the LadiTech team is accessible 24 hours a day, 7 days a week to site owners, agency partners, and freelancer partners. Whether you need one or more websites managed, we’ve got you covered.

Share this on