The webmaster will occasionally want to remove the sidebar links and widgets from a WordPress theme. If this occurs, you can do this by using the Widgets or simply modifying the source code of the ‘sidebar.php’ file in the WordPress Appearance editor.
There are multiple ways to disable sidebar widgets; in this tutorial, we are going to show you how to perform this task using the birdsite theme, the Widget editor, and the Appearance editor.
Check out Our Best VPS Hosting and WordPress hosting for scaling your cloud-based applications and processes.
Removing the Sidebar Links Widgets in WordPress
Completely deleting sidebar widgets through the widgets editor.
Step 1: Login to the WordPress Dashboard
Step 2: Click on ‘Appearance’, then click on ‘Widgets’.
Step 3: Now append a blank text widget.
This should now mean that the links and widgets are not going to be displayed.
If the widget text box isn’t available or won’t work, you can comment out the code in order to delete the sidebar links and widgets. This method is great as it will not affect the original source code.
If the source code is different and the site breaks, it could become difficult to recall which change broke it, especially if it is the removal of code that broke it.
Removing sidebar widgets completely through the code
Step 1: To begin, login to your WordPress Dashboard. Next, click on ‘Appearance’ and then ‘Editor’ on the left-hand side of the WordPress dashboard. Once you are at the ‘edit themes’ page, select the ‘sidebar.php’ page on the right-hand side in the ‘Templates’ section.
Step 2: After you have selected it, the code for the sidebar.php will load in the Theme editor window; make sure to take care when editing the source code of a WordPress theme as it could cause critical damage and, if the code is not edited correctly, the site may break. If you feel uncomfortable editing the code, be sure to check with a developer before continuing.
Step 3: Append a comment to the code like shown in the screenshot below. HTML comments will look like the following.
Step 4: Append the comment code to the page in the Theme editor then click on ‘Update File’.
On the next visit to your WordPress site, you should no longer see the sidebar, any widgets, or links.
Also, here we have a few hand-picked guides that you must read next: