How to Remove the Sidebar in WordPress

Do you want to remove the sidebar from your WordPress site? A sidebar is the widget-ready area in your WordPress theme. It often appears at the right or left side or below the content area on every page. In this article, we will show you… Read More »

The post How to Remove the Sidebar in WordPress appeared first on WPBeginner.

Do you want to remove the sidebar from your WordPress site? A sidebar is the widget-ready area in your WordPress theme. It often appears at the right or left side or below the content area on every page. In this article, we will show you how to easily remove the sidebar in WordPress.

How to Remove the Sidebar in WordPress

Why Remove the Sidebar in WordPress?

Most free and paid WordPress themes come with multiple sidebars or widget ready areas.

The purpose of sidebars in WordPress is to display items that are not part of the post or page content. Usually these are links to different areas of your website, advertisements, email list signup forms, social media profiles, etc. These items can be easily added to the sidebar of a theme using WordPress widgets.

Sidebar on a WordPress powered website

In most WordPress themes, sidebar appears differently when a user is viewing your site from a mobile device. Due to reduced width of the screen size, sidebars that appear on right or left on the desktop are moved to the bottom on mobile screens.

Sidebars are immensely helpful and can help you grow your business. See these WordPress sidebar tricks for maximum results.

However, some website owners feel that removing sidebar helps improve user experience. If you’re looking to remove the sidebar on your WordPress site, then this tutorial is for you.

Removing Sidebars From Everywhere in WordPress

This method allows you to simply remove sidebars from every page and post on your WordPress site. It requires you to edit WordPress theme files. If you haven’t done this before then see our guide on how to copy and paste code in WordPress.

First you need to connect to your WordPress site using an FTP client and then go to /wp-content/themes/your-current-theme/ folder.

WordPress themes are made up of different templates, so you will need to edit all the templates where a sidebar is displayed.

For example, in a typical WordPress theme you may need to edit index.php, page.php, single.php, archive.php, home.php and so on.

Open a template file to edit it and then locate the line that looks like this:

<?php get_sidebar(); ?>

If your theme comes with multiple sidebars, then you will see different instances of this code with a sidebar name inside the function. For example:

<?php get_sidebar('footer-widget-area'); ?>

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

Now, save and upload the file back to your website. Repeat the process for all template files responsible for displaying different pages on your website.

Once finished, you can go to your website and see it in action.

You may notice that while sidebars are gone, your content area is still appearing with the same width leaving the sidebar area empty.

Blank sidebar area in a WordPress theme

That’s because your theme has defined the width for the content area. Now that the sidebar is gone, you need to adjust the width of the content area by adding custom CSS to your theme.

First you will need to figure out the CSS class used by your theme to define the width of the content area. You can do that by using the Inspect tool in your browser.

Here is the sample CSS we used on our demo site using Twenty Sixteen theme.

.content-area {
    width: 100%;
    margin: 0px;
    border: 0px;
    padding: 0px;
}

.content-area .site {
margin:0px;
}

Here is how it looked without sidebars:

Sidebars removed from a WordPress theme

Removing Sidebars From Individual Pages in WordPress

It’s possible that you only want to remove the sidebars on certain pages while displaying them on other sections of your website.

For example, a lot of websites display sidebars on their blog page but not on individual blog posts. Some prefer to show sidebars everywhere except static pages.

Let’s take a look at different scenarios and how to remove sidebars from different areas.

Removing Sidebars from a Static Page in WordPress

Many WordPress themes come with ready-to use full width page templates. These templates can be used with any static page in WordPress and do not display sidebars on either side of the content.

You will just need to edit the page where you want to remove the sidebar and then select the full width template under ‘Page Attributes’ meta box.

Full width page template with no sidebars

If you do not see an option to select a template, then this means that your theme does not come with a full-width page template.

In that case, you will need to create a full-width page template manually. Open a plain text editor like Notepad and paste the following code in a blank file:

<?php
/*
*
Template Name: Full-Width
*/
get_header(); ?>

Now save this file as full-width.php on your desktop.

Connect to your WordPress site using an FTP client and then go to /wp-content/themes/your-current-theme/ folder. Edit the file called page.php and copy every thing that appears after <?php get_header(); ?> line.

Now paste this code in your full-width.php file. After that you need to locate and delete the line that looks like this:

<?php get_sidebar(); ?>

Save your changes and upload the full-width.php file to your current theme folder.

You can now edit any page on your WordPress site and you will be able to select your full width page template.

For more details, see our guide on how to create a full width page template in WordPress.

Remove Sidebar from Blog Posts Page in WordPress

WordPress allows you to use a static front page and a separate page for your blog posts. Usually, most WordPress themes display sidebars on the blog posts page.

If you don’t want to display sidebars on the blog posts page, then you need to go to Settings » Reading page. Notice the name of the page you are using as your blog posts page.

Find your WordPress blog page

Now go to Pages » All Pages and edit the page used to display your blog posts. Under the page attribute section select a full width template and then save your changes.

Full width page template with no sidebars

If you don’t see a full width template option, then you will have to manually create a full width template. See the previous section in this article for detailed instructions.

Remove Sidebar from a Single Post in WordPress

If you want to remove sidebar from certain single posts, then you can create a custom single post template.

WordPress 4.7 came with built-in support for post templates. You’d need to follow the steps outline in our guide on how to create custom single post templates in WordPress.

In your custom single post template all you need to do is make sure to remove the sidebar part of the code.

We hope this article helped you learn how to easily remove the sidebar in WordPress themes. You may also want to see our step by step guide on how to boost WordPress speed and performance.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Remove the Sidebar in WordPress appeared first on WPBeginner.

12 WordPress Sidebar Tricks to Get Maximum Results

Most WordPress sites have a two column layout containing the content and sidebar. Despite being visible on every page of a website, sidebars are often the least optimized areas. In this article, we will share the best WordPress sidebar tricks to get maximum results for… Read More »

The post 12 WordPress Sidebar Tricks to Get Maximum Results appeared first on WPBeginner.

Most WordPress sites have a two column layout containing the content and sidebar. Despite being visible on every page of a website, sidebars are often the least optimized areas. In this article, we will share the best WordPress sidebar tricks to get maximum results for your site.

WordPress sidebar tricks

1. Dynamic Widgets for Sidebar

Show/Hide widgets on different pages and sections

By default, your WordPress sidebars remain the same. This means that you are showing users the same sidebar whether they are viewing an archive page, category, home page, or a single page.

Depending on what content user is looking at, changing sidebar widgets accordingly can make a huge impact on how users interact with the sidebar on your site.

Using Display Widgets plugin, you can show and hide sidebar widgets on posts, pages, archives, home, or blog page. You can also show or hide widgets to users based on their login status.

2. Multiple Sidebars

Content aware sidebars

Another approach to creating smart sidebars is by using multiple sidebars at once. Each sidebar appears based on a criteria you select.

Install and activate Content Aware Sidebars plugin. It allows you to create smart sidebars. Instead of showing or hiding widgets for specific pages, you can create totally new sidebars for them.

3. Sticky Sidebar Widgets

Sticky sidebar widget

Usually the content column of your website becomes a bit lengthier than your sidebar. This means that when users scroll down, there is nothing to look at in the sidebar column.

You can add sticky floating sidebar widgets to make sure that there is always a call to action visible to your readers as they scroll down.

4. Email Subscription

Email signup form

Ever wondered why email signup forms are often the first item in sidebars of most popular blogs? That’s because email is still the most successful way to communicate with your readers. See our guide on why you should start building your email list right away.

Most email service providers like MailChimp, AWeber, etc, will provide you simple code that you can add to a text widget in your WordPress sidebar. However, these signup forms are not very effective in terms of conversion.

By using OptinMonster to create beautiful and highly engaging sidebar optin forms, you can significantly increase your conversions.

OptinMonster also allows you to A/B test your sidebar optin forms, so you can make data-driven decisions about what’s working and what’s not.

5. Showcase Your Best Content

Popular posts

WordPress sites come with a built-in recent posts widget. This widget does not perform very well.

The reason is simple, your recent posts may not always be the best content to describe your site to a new user.

You should use a popular posts plugin to display your most popular content. You can also combine it with a related posts plugin to showcase the most relevant content to new users.

6. Dynamic Custom Lists

Custom WordPress Lists

Why stop on just popular or related posts? You can create your own lists of posts that you think will bring you more conversion.

Simply create a new post in WordPress and use the visual editor to create a bulleted list of posts or pages you want to display. Switch to the text editor and copy the HTML code.

Now add a new text widget to your sidebar and paste the HTML code inside it. You can create as many lists as you want and show different lists for different areas of your website.

7. Use Images

Use images in sidebar

Images are much more engaging than plain text. If you want to grab user’s attention, then use images as banners and buttons. You can link those banners and call to actions to different areas of your website.

You can simply upload an image using the media uploader and add the HTML code to display the image in a text widget. If you are not familiar with HTML, then you can use an image widget to add images in your WordPress sidebar.

See our guide on how to add an image in WordPress sidebar widget for detailed instructions.

In the OptinMonster blog example above, when the user clicks on an image, it loads a popup asking them to enter their information. That’s called MonsterLinks which is a 2 Step Optin Technology..

8. Showcase Social Proof

Add social proof

Have you seen how popular blogs brag about their follower count in their sidebars? Displaying your follower count in the sidebar is called social proof. It is a marketing technique that helps you gain trust by showing people the number of followers you already have.

You can use Social Count Plus widget to display your follower count. You can also show your MailChimp subscriber count to encourage more users to signup for your email list.

Here are 11 more social proof examples that you can add on your website.

9. User Engagement Tools

Recent comments with thumbnails

Recent comments, polls and surveys, user rankings, points system, are just some of the ways to boost user engagement on your WordPress site. Displaying them in your sidebar helps boost user engagement on your website. This increases your pageviews and time each person spends on your site.

10. Fade In Last Sidebar Widget

Fade in sidebar widget

This nifty little trick is used on many popular blogs and websites. It simply fades in the last sidebar widget. The animation makes the widget eye-catchy and noticeable which dramatically increases the click-through rate.

See our tutorial on how to fade in last sidebar widget in WordPress.

11. Use Custom Styles for Widgets

Custom styles for sidebar widgets

Usually all sidebar widgets use the same colors and style defined by your WordPress theme. This makes them all look the same. You can use custom styles to use different colors for some of your widgets to make them more noticeable.

See our guide on how to add custom styles to WordPress widgets for detailed instructions.

12. Enable Shortcodes in Text Widgets

By default, WordPress filters out shortcodes in text widgets. You can easily disable that by adding this single line of code to your theme’s functions.php file or a site-specific plugin.

add_filter('widget_text','do_shortcode');

We hope this article helped you learn some new WordPress sidebar tricks to get maximum results on your site. You may also want to see our list of 25 most useful WordPress widgets for your site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 12 WordPress Sidebar Tricks to Get Maximum Results appeared first on WPBeginner.