Choosing a widget control plugin for WordPress

In: , , , , , ,

For the past few months I have used the Widget Context plugin on my WordPress blog in order to control where widgets show up on my site. Everything you see in the two right-hand columns of my site is widget-based, as are the 3 columns that display teasers for featured posts.

But I don’t want all these sidebar and teaser goodies to show up in exactly the same way on every part of my blog, which is where Widget Context comes in. It is one of several different plugins that promise greater control over where widgets appear, so that you can establish different settings for each widget.

My ideal case is a plugin that lets me determine where an individual widget appears based on my choice of:

  • page type (for example, single post vs blog page vs category archive)
  • category or tag (setting a widget to appear or hide on any post belonging to a specific category)
  • specific URL

After several months of using Widget Context I decided to try out some alternatives. Below, you’ll find my summary of how each of four different plugins works:

  1. Widget Context
  2. Widget Logic
  3. Display Widgets
  4. TS Custom Widgets

1. Widget Context

Widget Context gives you an extra menu within the configuration box for each individual widget, on the widgets page. It’s pretty much exactly what I needed, except for the fact that the “target by URL” feature is glitchy; I haven’t been able to set my widgets to show/hide by category or URL, only by page type.

If you’re only planning to control widgets by page type, this is your easiest option. If you want to control widgets by referencing specific URLs or categories, you can check out the solutions described here, but be prepared for having to find a Plan B. That’s why I tried out the plugins below.

And don’t be afraid to try out Widget Context first, and look for alternatives only if needed.Widget Context remembers the settings for each widget even if you deactivate the plugin and then reactivate it later. So you can configure your widgets in Widget Context, and if you decide to try something else, come back to Widget Context without losing your settings.

2. Widget Logic

Widget Logic uses code to customize each widget by giving you access to WordPress’ system of conditional tags. Once you activate the plugin you will see a new field inside the configuration box for each of your widgets, which you can use to enter a rule about where that widget should appear or hide.

It’s efficient but you have to be comfortable working with code, figuring out logic and looking up the numbers for any categories or tags. The easiest way to get a sense of the kind of code this involves is to look at the list of examples on the plugin’s documentation page or read this handy overview of how to use it.

For example, to get my podcast widget to show up on any single blog post in the “HBR” category, AND on the home page, I entered: in_category(711)||is_home() This worked perfectly: the widget showed up exactly where it was supposed to and the pages loaded nice and fast.

Note that any typos in your code produce ugly errors so be sure to check the posts/pages where you expect you widget to appear (or hide) to make sure you haven’t got any ugly glitches.

If you’re comfortable working with a little bit of code this may well be the option you like best. If you don’t want to deal with anything code-like, or you are planning to work with lots of category and tag rules (which will require you to look up the category and tag number each time) you may find it a bit of a hassle.


3. Display widgets

 

Display Widgets gives you a scrollbox inside each widget’s settings box, with checkboxes for each page, category or page/post type on the site. You choose either “hide on selected” or “show on selected” and then choose the pages, categories and page/post types to exclude/include.

It works, though it seemed to slow my site significantly. Some other limitations:

  • Can’t filter on tags, just categories.
  • Doesn’t work for widgets written in the pre-2.8 format. On my blog that meant it worked on “category posts” “text” and “archives”  but not “related posts” “simple image” or “find me on”, “random image”.

If you are only trying to exercise nuanced controls over widgets that are 2.8-based and therefore friendly to Display Widgets, this could be a better option that Widget Context since the category-based filtering seems to work better. But bear in mind that you have no option for controlling your widgets’ placement by specific URL or by tag. Most crucially, prepare yourself for switching back-and-forth between plugin options if it turns out that you want to control a widget that isn’t supported by this plugin.

4. Custom widgets

With Custom Widgets you start by setting up your widgets, then go to a different settings page for Custom Widgets. From there you go to the settings page for that individual widget. There are a LOT of customization options but you have to keep track of which widget you are customizing, which can be tricky if you have widgets with duplicate titles (for example, my “simple image” widget, which i use multiple times.) Note that this is an older plugin so may not work with upcoming versions of WordPress.

It works but it is a VERY cumbersome configuration process. Personally I find the idea of learning enough PHP to use Widget Logic a lot less daunting than using Custom Widgets. It’s hard for me to imagine a use case for this plugin, unless you are (a) customizing only one or two widgets, (b) totally unwilling to do any coding as required by Widget Logic, and (c) desperate to limit a widget’s appearance by category or tag (which is what doesn’t seem to work in Widget Context.)

Results

Widget Logic is the best option in terms of getting the display results I want; Widget Context is the easier plugin to configure. So why choose? I have activated both plugins and it’s relatively easy to use them together.

Just use Widget Context for any widget you want to customize by page type (for example, show only on category archives) and then use Widget Logic if you want to customize by category, tag or URL.  When you’re using Widget Logic to control a widget, just leave the Widget Context options set to “Hide on selected” and leave everything unchecked.

Don’t try to combine the two plugins on a single widget; I tried a variety of combinations and found that I couldn’t get the results I wanted by combining the two. But I tested pages that had some widgets controlled by Widget Logic, and others combined by Widget Context, and everything behaved as intended.

17 Comments on this site

  1. dazzlr

    Very useful post, thank you.

    I am a new WP user setting up a website for my wife's business http://www.designforlifecoaching.com (in its very early stages right now), and love the power of WP but don't want my website to look too much like a blog.

    I was using Custom Widgets, but since I am now aware of these other products I will give them a try also. In my case I am attempting to add widgets on a per-page basis and Custom Widgets seems to do that just fine.

    Thanks again for the info!
    dazzlr

  2. dazzlr

    Very useful post, thank you.

    I am a new WP user setting up a website for my wife's business http://www.designforlifecoaching.com (in its very early stages right now), and love the power of WP but don't want my website to look too much like a blog.

    I was using Custom Widgets, but since I am now aware of these other products I will give them a try also. In my case I am attempting to add widgets on a per-page basis and Custom Widgets seems to do that just fine.

    Thanks again for the info!
    dazzlr

  3. Sean

    Thanks for the research. It seems 'Widget Logic' and 'Display Widgets' merely prints or deletes the contents of the sidebar blocks, leaving the sidebar DIVs in place. Whereas 'Widget Context' actually controls whether or not the sidebars get rendered at all. This is important because if you use either of the first two, with widgets created for both sidebars, all your pages will be identified to the CSS as three-column, even ones you choose not to display any widgets. This is particularly important if you use a dynamic template, like K2. Other templates may not be bothered as much.

  4. Alexandra Samuel

    __

    Alexandra Samuel, Ph.D.
    Director, Social + Interactive Media Centre
    Emily Carr University

    alex@alexandrasamuel.com
    tel. 604.630.4545
    cel. 604.726.5445
    Twitter/AIM/Skype awsamuel

  5. Sheldon Nesdale

    Thank you very much for your review. A search of WordPress.org wasn't generating a list of potentials. Thanks to you I have installed several and found Display Widgets to be exactly what I needed.

  6. himanshu p

    Cool post……. not lot of people look for such topics but the one’s who land here , go back with a better solution

    THANKS 🙂

  7. Heather Wood

    This was so helpful. Thanks so much. I love the fact that your a geeky woman. Not many of us around! ^_^

  8. Jonathon Byrd

    Don’t forget about Total Widget Control, http://codecongo.com/items/1/Total-Widget-Control.html Personally I think it dominates over any other widget management plugin.

    It provides the ability to assign widgets to posts, pages, clts, categories, taxonomies, post tags.. Also the ability to show widgets to specific user groups or after a publishing date. Also has the ability to display widgets to all child objects of pages, categories and such. Phenomenal plugin!

  9. Federico

    Thanks for this article. Widget logic wasn’t working for me, I moved to widget context and it was all a breeze.

  10. jane

    Just what I needed. Thank you for posting.

  11. Johnseaford

    Custom widgets is the only one that does exactly what I tell it to do, without fail.

  12. SEOCoach

    Many thanks – Widget Logic was exactly what I was looking for (and the NZ summary you linked to had an example that covered my need perfectly).
    This has saved me a few grey hairs!

  13. Karl Craig-West

    Brilliant, big thanks indeed for that. Widget management has often been a pain in the proverbial so I’m more than pleased that you’ve given me some simplified options.

  14. Tyler Perkins

    awesome job here, you helped me find exactly what I knew existed some where, just had not idea where!! Nice

Trackbacks/Pingbacks

  1. wp-popular.com » Blog Archive » Choosing a widget control plugin for Wordpress | Alexandra Samuel - [...] the original post: Choosing a widget control plugin for Wordpress | Alexandra Samuel Tags: result, tutorial, usuful, [...]
  2. sidebars and widgets - [...] conclusion basically mirrors that of the blog post Choosing a widget control plugin for WordPress. thanks for the helpful…

Submit a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share This