Have you ever used a WordPress theme with more than a couple of widget areas? More specifically, have you ever used a WordPress theme with loads of widget areas and no idea how they all worked within the theme?
If you’ve ever used a theme of mine, you know I love adding widget areas everywhere. And, I know this can be confusing for some people.
Fortunately, WordPress 2.9 will allow theme developers to add a description for each widget area. This should help end users figure out what the heck is going on.
Widget descriptions from a user’s view
If you’re an end user and your theme author has added descriptions, you’ll see the description near the top of the widget area on the Widgets admin screen.

Adding descriptions to widget areas
If you’re a theme developer, adding descriptions to your widget areas is as simple as adding an extra argument to the register_sidebar() function. Use the below PHP code as a guide.
add_action( 'init', 'register_my_widget_areas' );
function register_my_widget_areas() {
register_sidebar( array(
'name' => __('Primary', 'example'),
'id' => 'primary',
'description' => __('The main widget area, most often used as a sidebar.', 'example'),
'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
) );
}
The new code allowed in 2.9 is the description argument.
'description' => __('The main widget area, most often used as a sidebar.', 'example'),
Theme authors, it’s time to implement this new feature for your users. It will take less than five minutes to add to your theme and should at least cut back on a few support queries.
Noted! Will add that to any child themes, or regular themes with additional widget areas!
Good to hear. I’m still updating themes.
Do you know if adding this before the 2.9 release will cause errors for earlier versions of WP?
Glad they committed that ticket. This will come in handy for a lot of themes.
@Mike Smith: No it won’t affect any earlier versions of WP as the description field simply gets disregarded.
Hey Justin,
I’m not a theme developer, but a user of course. I could see how adding this description argument could be very useful to the user and, in my opinion, only adds to the “professionalism” of any well developed theme. It’s the little things like this that go a long way in making a theme user-friendly.
Jake
Definitely. Little things like this just make it more useful.
@Ptah – thanks for the response. It’s good to know, and something I’ll be putting together for the themes I’m releasing on Jan 1st.
Right on. Makes me wonder when they will just drop the inaccurate “sidebar” name and call it something more generic such as “container” or some such as most of us are using them throughout the theme to handle all sorts or requirements.
I’m not sure if they’ll ever do it. I’ve brought it up several times, but I’m guessing the core devs are content with sidebar.
I have been contemplating blogging after following so many blogs, and I am tending towards WP
Is there any way to group the custom widgets? Normally, there are two widgets groups in the widgets admin panel; ‘Available Widgets’ and ‘Inactive Widgets’. I think it’d be cool if the widgets provided by the theme (or plugin) can have their own group.
whether this method works for hybrid themes? because the hybrid theme has no sidebar and how I can add a sidebar for hybrid themes. thanks you so much justin. i love you blog
If you have questions about Hybrid, please stop by its support forum. Someone will help you out there.
I was reading about this today on Yoasts Geeky WP2.9 article and I wondered how long it would take you to add descriptions to all the different sidebars to give me a direction of where on the site those widgets will be displayed. This is a nice change.
I was on top of it as soon as the ticket was committed.
Hi Justin,
I am using your hybrid theme, and i am so satisfied… but there are so many functions i don’t know… Let me Thank you so much for this widget description, so helpful
You’re welcome. I hope the new descriptions come in handy.
I gotta tell you, PHP code is NOT my thing, thanks for making it easy for me.. the original WP widgets are just dull..
This is a great thing I am in the middle of a theme right now and this will bring a great deal of organization to my project. I wonder why it took so long?
I’m not sure. Maybe no one brought up the idea until recently. Developers sometimes overlook these simple things, at least until a user comes along with an idea.
Hi Justin,
Whether can do it like this: Index, single, page all have their own sidebar? I do not love every page have the same sidebar.
Thanks.
Check out the Widget Logic or Widget Context plugin.
Valuable information!! I tried the code you given and got the result. Providing a description is good idea to our visitors.. THANKS FOR THE POST.
I wish the developers had used a name other than “sidebar” to describe the area that contains widgets since you can widgetize any part of a theme.
Finnaly, I wonder why it took so long..
greetings darila
Btw, how to hide widget on single post… or to show widget on homepage only?
Thanks for sharing such a useful information with us. Keep on writing.
Wooo finally! So this feature is available by version 2.9 of our beloved WP? This is gonna be very useful especially for those who are not very familiar with widgets and where they go. I’ve been blogging for a long time both on the free WP blog and personally hosted WP, and up to now I still get confused by these widgets. I do hope designers and developers will make the time to add the descriptions to their already excellent creations.
I can see this helping the end user…but what I would really like to see WP do is allow entering a title to the widget but being able to “not” display it in the front-end. I still yet to see anything that can do that simply by having a function added to every widget to display or not display the title.
You can probably show/hide it with the
widget_titlefilter hook. I think the idea is outside the scope of WordPress though and should be handled via a plugin.thank you for this interesting info. i was looking for something like this.
I just try validate my WP blog and I see Text widget give validation errors even is empty, even it have inserted a piece of code inside. I use WP v2.8
W3C Validator verify the same HTML source code which I view in the my browser and indicate me the place of them, but I dont know where is the code which I have to corect.
What is/are the name of file(s) I must fix?
All that wrong “li” and “ul” about Validator tell me to fix, are part of Wordpress code not mine.
Please tell me if version 2.9 contains a new text widget, which permits W3C validation.
Thank you.
This is probably a validation error from your theme. The default WordPress widgets output valid HTML.
Oh, for “Wordpress 2.9″, that’s why I spent the last 4 hours trying to figure out what I did wrong.
After the 2.9 upgrade it worked perfectly
We’ve all done something like this a time or two.
thank you your useful post
thanks a lot. was looking for something like this. helps a lot.
Thanks for this tip.
I was thinking of making my site to have something like having images on the post excerpt and then when they click on it takes them to the single post and now its built in on 2.9. Great.
- j
Thank you 2.9 great..
Thanks for the script and the information. Have already included it.
thanks for sharing, didnt know this new feature in 2.9 version. I cant image what else they will put in 3.0???
This is a great Wordpress Blog. What theme are you using?
Thank you for this interesting info. I love 2.9!
Valuable information!! I tried the code you given and got the result. Providing a description is good idea to our visitors..
THANKS FOR THE POST.
I really need this information. I need it for changing and categorizing widgets in my site. It’s very helpful. Thank you.
Where do you put the code to change the sidebars?
Great. I will consider your ideas although I already knew few things in making my widget more interactive and interesting for visitors.
Interesting information, I am a new wordpress user so your articles useful for me to learn it.. Thanks
Widgets are easy to manage as long as you know what to include in your widget. It’s very flexible to use. Thanks for sharing great ideas for us.
Description for widget areas are very helpful for your visitors. We should all provide an accessible place for them to navigate your site and this will show the user friendly site.
Can anybody explain me how the heck the %2$s works?
I’ve been trying to get the widget number, without the word “text-” before it, and I can’t figure it out.
Is that a way to retrieve ANY variable?
Do they have to be setup to be retrieved with that percent sign?
Is there other way to get the widget number (inside that sidebar)?
Thanks.
I like this site and saw it on AOL search. I think your thoughts on istanbul information guide | TTG Travel Istanbul are right on. Thanks for writing about this and looking forward to reading more on your site.