How to Have Different Sidebar Content On Different Pages of Your WordPress Site

Buffer this pageTweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone

how to have different sidebar content on different pages of your wordpress site

Many WordPress themes do not yet provide a way to have totally different sidebar content on different pages of your site. Some may provide a little flexibility with, for example a sidebar for the blog and a different sidebar for static pages, but sometimes you need more comprehensive control – for example you may need an additional set of navigation on a certain set of sub-pages. There’s several different plugins that help you gain this type of flexibility with your site.

Display Widgets

The Display Widgets plugin is perhaps the simplest and most user-friendly option. After activating the plugin you will notice that when you add a widget to your sidebar, there is a system of checkboxes whereby you can easily tell the widget to show up, or not to show up on certain pages/posts or types of pages/posts. In addition you can choose to display a widget based on whether a user is logged in or not, which would be handy if you have any kind of membership site or protected content pages. This plugin is easy enough for beginners to use!

Using Display Widgets WordPress PluginUsing Display Widgets WordPress Plugin


Dynamic Widgets

Using Dynamic Widgets WordPress PluginThe Dynamic Widgets plugin does a very similar job to Display Widgets, but  adds a couple of extra controls for widgets which you may find useful. The interface is perhaps not as immediately easy to use as Display Widgets, becuase it actually takes you to a separate page to control the settings for each widget, but the extra features, provided by checkboxes are:

  • Display widget according to the user’s role, including any custom roles you have created
  • Display according to date – this could be really handy if you want to run a promotion of some kind – you can specify the dates a widget can be shown
  • Display according to browser – not sure how you might use this (other than telling people on Internet Explorer 6 to upgrade…) but it sure is cool!

Widget Logic Plugin

This was one of the original plugins I used for controlling widgets and I’m including it in the list for more advanced users who don’t want to deal with checkboxes and are comfortable with WordPress conditional tags. This plugin adds a simple field to each widget which requires you use a conditional tag to control where the widget displays.  It’s not too hard once you understand it, but definitely not user-friendly off the bat.

For example, to make the widget show up only on single post pages, you would enter the tag:  is_single()

To make it show up on a specific post or page you need the ID number of the page which is not readily available on any admin screen. You need to actually look in the url when editing a post/page to look for the id number. Or you can install this handy plugin called Reveal IDs which will conveniently show the IDs in a column inside the admin area. So you identify a page/post that you want a widget to display on, locate the ID and use the following tag:  is_single( ‘106’ )
where 106 is the ID of that page/post.

You can do all sorts of combinations to test for things like sub-pages etc. Anything you can do with a conditional tag, you can apply to a widget.

These three plugins so far have given you control over where and how individual widgets show up in the existing sidebars your theme already provides. So this means that when in your Widgets screen, you’ll see a sidebar are with several widgets inside, some of which show throughout the site, and some that show only on certain pages. There’s nothing wrong with this set up, although if you have a lot of widgets it could be confusing to keep things organized and to determine at a glance which widget is going to show up in which sidebar.

So another approach is to use a plugin that enables you to create entirely new sidebar areas that appear on your Widgets screen.

Custom Sidebars Plugin

With this plugin you can create new sidebars to use in your theme and you can then designate which sidebar shows up on which page. The interface is not particularly user-friendly, but once you get how it works, it does do the job nicely. It’s a 4-step process.

  1. You have to specify which of your current sidebars are “replaceable”. This means you can choose to replace one of your theme’s default sidebars with a custom one.
  2. After you have selected one that can be replaced, you can then make a new sidebar.
  3. Now when you are on your page editing screen you’ll have a box and drop down where you can specify which sidebar will show up on that page.
  4. You add widgets to that particular sidebar on the Appearance > Widgets screen as usual.
Custom Sidebars Plugin
Custom Sidebars Plugin

So now when you go to your Widgets screen you will see a dedicated area for the new sidebar you have created:

Custom Sidebars Plugin

Per Page Sidebars Plugin

This plugin does the same job as custom sidebars but has a little better workflow. On your page editing screen you will now see a box where you can enable a custom sidebar for that page, and choose which of your current sidebars you would replace.After you make your selection and save the page, when you head over to the widgets screen you’ll see a new widget area labelled with your page name.

Both plugins seem to work equally fine – the only difference would be your preference for which workflow you prefer.


Weekly WordPress Tips To Your Inbox

+ Get 50% Off The Beginner's Guide to SEO Ebook!
  • This field is for validation purposes and should be left unchanged.
Buffer this pageTweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone

This Post Has 9 Comments

  1. Tim Topham

    Great article. I’d somehow manage to load about three of these plugins and needed to know the differences so I could just use the one I needed. Thanks again!

  2. Jana

    Thanks for explaining things simply. I am new to using WordPress and would like to set a different custom menu for each page in a sidebar for a few of my pages. I have Jetpack, so I can create the menus, but I don't know which plugin would allow me to use a particular menu on that page. For example: I created a menu for my About page with a contact page, an about us page, and an application page. Then I created another menu for Previous Projects with menu items for different years – 2009, 2010, 2012. I only have the option of choosing one menu, and it shows on both pages. Which plugin will allow me to do what I want? Thanks again for the help.

    1. LucyBeer

      Hi Jana
      Menus are feature of core WordPress, not specifically JetPack. But actually in one of the recent updates to JetPack they added "Widget Visibility" so you can add several custom menu widgets to your sidebar but for each one you can specify which on pages each menu widget should show up.
      The Display Widgets plugin mentioned above will also do the trick.

  3. Jessica Hagan

    This is an excellent resource! Thanks for always providing such useful information in common English!

    Here's a little question for you. Do you know if any of these widget plugins allow you to rearrange the order of display per page? So that one widget is at the bottom of one page but at the top of another?

    I <3 Lucy!

    1. LucyBeer

      Hey Jessica – thanks for your kind words! Glad you are finding this helpful. In the case you describe I would use something like the Per Page Sidebars plugin. That way you can create a new sidebar for each page that you need something different for. This will be the easiest way to get the exact arrangement you want.

  4. Jose Velasquez

    Your comments have been very helpful but I was looking for a tutorial where you can choose a sidebar for specific category. For example if you choose a category I like to see a specific sidebar for that category and so on. Do you have any idea??? I would appreciate any help or information that you can provide.

    Jose Velasquez

    1. LucyBeer

      Hi Jose
      You can do this with the plugin I refer to called "Custom Sidebars". In the plugin you can create a sidebar and assign it to be used for a specific category.

  5. Ann Marie Gill

    I hadn't heard about Display Widgets – good one. I have been using the unsupported Slayer Widget for my sidebars which works pretty well but has been removed from the WP plugin depository. I tried Dynamic Widgets but it caused conflicts with editing other widgets. Thanks for the list. This is such an important feature to have that I hope future versions of WP include different sidebars. Looking forward to meeting you at Wordcamp! Like your blog – my first visit!

    1. LucyBeer

      Hey there – thanks for checking out my blog! Display Widgets will definitely make your life easier and it\’s straightforward enough that your clients can manage it as well. Definitely come say \”hi\” at WordCamp!

Leave a Reply

Your email address will not be published. Required fields are marked *