
Removing the Sidebar Links/Widgets in WordPress
When working with a WordPress theme, occasionally, the webmaster may want to completely remove the sidebar links and widgets from the theme. This can be done through the Widgets or by editing the source code of the sidebar.php file in the WordPress Appearance editor.
(Not a current customer? Click here to learn more about InMotion's WordPress Hosting platform.)
There are several ways the sidebar widgets can be disabled. This article will explain how to completely remove the sidebar links and widgets from the birdsite theme through the Widget editor and through the Appearance editor.
Removing sidebar widgets completely through the widgets editor
- Log into the Wordpress Dashboard
- Navigate to Appearance > Widgets. Click here for information on removing and adding widgets.
- Add a blank text widget.
Now the links and widgets will not display.
If for whatever reason, the widget text box is not available or does not work, the code can be commented out to remove the sidebar links and widgets. Commenting the code is good because the original source code is not changed. If the source code is changed and the site breaks, it can be difficult to remember what change broke it, Especially if the code is deleted.
Removing sidebar widgets completely through the code
- Log into the Wordpress Dashboard
Navigate to Appearance > Editor on the left in the Wordpress Dashboard.
On the Edit Themes page, select the sidbar.php page on the right hand side in the Templates section.
The code for the sidebar.php will load in the Theme editor window.
Important! Editing the source code of a WordPress theme is a critical change. If the code is not edited correctly, the site WILL break. If you are not comfortable editing the code, please check with a developer before proceeding.
Add a comment to the code like in the snapshot to the right. HTML comments look like the following:
<!-- Begin Comment
Code goes in between here
End Comment -->Add the comment code to the page in the Theme editor and Click Update File
Now when visiting the WordPress site, the sidebar will not display any widgets or links at all.
To learn more about Widgets, please visit Introduction to Plugins & Widgets
‹
Section 6: Deactivating Widgets from the Sidebar in WordPress
|
›
Section 8: Completely disabling Comments from WordPress in the code
|
Related Questions
Support Center Login
Our Login page has moved. Please click the button below to be redirected to the login page.Recent Articles
Introduction to Plugins and Widgets
![]() n/a Points
|
2019-01-25 6:14 pm
Hello, I have tried everything on this page and still getting parsing errors? I copied the exact comment code that is pictured above in #4 and continue to get errors and a space where the sidebar was ... is there exact code that works? thanks in advance |
Staff 776 Points
|
2019-01-25 6:18 pm
I recommend you try having the comment code on separate lines - i.e.:
Or contact the theme developer. |
![]() n/a Points
|
2019-01-10 7:15 am
Thanks for the code. Removed archieves completely! |
![]() n/a Points
|
2018-12-28 7:40 pm
I used this method and the sidebar is removed, BUT the things that went to the sidebar went to the bottom of the page. How can I fix this? |
![]() n/a Points
|
2018-07-14 2:24 am
Why even bother removing the Sidebar? Just find a theme that doesn't use one. Oh wait, that's impossible 99.9% of themes have sidebars, they're quite annoying especially when you want to add character sheets from a game that I play. Personally, I have a hard time understand the instructions even given showing images on how.. I just still don't get the flipping point. But, then again I am slow at things and it takes a bit for me to understand something that appears so simple. *Sighs* I Need a FULL-Width Theme with Header and Footer ONLY no side bar stuff. Laura the frustrated.
|
Staff 3,536 Points
|
2018-07-16 11:32 am
I'm sorry to see about you being frustrated, Laura, I can definitely understand! Which step are you experiencing an issue with? We are happy to assist further or update the guide to be more helpful!
|
![]() n/a Points
|
2019-02-07 6:00 pm
Hi Laura, I think I understand why you're not able to follow this. I'm having the same issue but I finally figured out why. In my case, the "theme file" didn't actually have a "sidebar.php" For me, the "sidebar.php" is part of a parent theme. |
![]() n/a Points
|
2018-06-25 8:49 am
I want to remove the side bar from a specific page not from all the theme. |
Staff 1,173 Points
|
2018-06-25 12:24 pm
To do that you would need to create a separate page template in the theme that does not have the sidebar and assign that template to the page you do not want it to display on.
|
![]() n/a Points
|
2018-05-24 11:04 pm
Please reply the whole code. Please. |
Staff 3,536 Points
|
2018-05-25 1:42 pm
Our apologies, I modified the article so that the code would be displayed properly. I hope this helps!
|
![]() n/a Points
|
2018-02-25 2:17 pm
I want to remove Side bar from my Wordpress blogs. |
Staff 3,536 Points
|
2018-02-26 11:44 am
Are you experiencing an issue following the instructions here for removing the sidebar? If so, can you please elaborate on the steps you are taking and what errors you are receiving?
|
![]() n/a Points
|
2017-11-15 4:35 am
I want to hide sidebar from the specific post on my blog https://vijaybhabhor.com/marketing/conversions/wordpress-plugins/, please let me know is there any way to hide this? |
Staff 42,596 Points
|
2017-11-15 10:52 am
Removing the sidebar for a specific post will require some coding. The WordPress community has provided various answers for this in this particular forum. Check out the solutions and see which works best for you.
|
![]() n/a Points
|
2017-08-10 5:02 am
Excellent post! This is worked great. It just made my work easily. I like this post absolutely.
Thanks. |
![]() n/a Points
|
2017-07-04 2:13 am
Thanks. This worked great as I am new to wordpress. Very good! |
![]() n/a Points
|
2017-04-10 2:25 am
I used this update and now my wordpress is broken plus I cant even log back into wordpress admin. |
Staff 43,761 Points
|
2017-04-10 11:41 am
Disabling the sidebar widget will not affect the login. That appears to be a different issue. Check out our article on Common WordPress Troubleshooting Techniques.
|
![]() n/a Points
|
2016-12-01 8:31 am
This is not working on my themes please give another way to remove sidebar on my thmes i am not a good php devloper that for you shoud simple answar to me
|
Staff 31,445 Points
|
2016-12-01 1:42 pm
Here is a helpful post from the official WordPress forums, where they discuss additional ways to remove the sidebar.
Thank you, John-Paul |
![]() n/a Points
|
2016-06-27 7:24 am
Thank you very much. I am not very experienced with php and things, but I managed to get rid of the thing. Excellent. |
![]() n/a Points
|
2016-03-25 5:13 pm
OK, so now there's no content IN the sidebar, but there's still space for it. How do I make the space go away and the text part move to the center of the page? |
Staff 43,761 Points
|
2016-03-28 1:05 pm
Removing the content does not change the structure of the theme. It still will contain the column, although empty. To change that you would either need to modify the theme code or find another theme that does not have that column.
|
![]() n/a Points
|
2018-12-14 12:04 pm
In my case, it left the column displaying only "End Comment -->" |
Staff 776 Points
|
2018-12-14 12:09 pm
You can try making multiple comment-out codes or moving the --> to the next line to see if that works.
|
![]() n/a Points
|
2016-09-16 7:58 pm
After removing the sidebar, you may remove the space it was in by adjusting the child theme settings. In the dashboard go to Child Theme > Settings > Layout and change the 'main layout' to the first box, so click the box that has no gray inside of it, indicating no columns on all pages.
|
![]() n/a Points
|
2015-06-13 8:11 am
Thank you so much. this worked for me. very simple logic, great. |
Search
Ask the Community!
Current Customers
Chat: | Click to Chat Now | E-mail: | support@InMotionHosting.com |
---|---|---|---|
Call: | 888-321-HOST (4678) | Ticket: | Submit a Support Ticket |
Post a Comment