Last week I was having a really hard time ordering the categories in this blog’s header as WordPress only seems to allow to order by name or by ID. That’s why I came up with the Category Order plugin.
Description
The Category Order plugin allows you to easily reorder your categories the way you want via drag and drop. It doesn’t require a special widget or anything, just install and reorder.
Requirements
This plugin requires that you use at least WordPress 2.3, although it has only been tested on WordPress 2.5.1
Download
Installation
- Download the plugin and expand it.
- Copy the ‘category-order.php’ file into your plugins folder (wp-content/plugins/).
- Login into the WordPress administration area and go to the Plugins page.
- Locate the Category Order plugin and click on the activate link
- That’s it, now you can go to Manage » Category Order and reorder the categories the way you want.
- If you use wp_list_categories(), make sure you don’t specify an order (e.g. wp_list_categories(’orderby=count’);).
Version History
- 1.0.3 - If no order is specified, categories are ordered by name
- 1.0.2 - Fixed a problem related to PHP 4
- 1.0.1 - Fixed a problem where the plugin wouldn’t work properly if you had installed WordPress in a subdirectory
- 1.0 - Initial Release
Donate
Support further plugin development by making a small donation:

I really need “Category Order “,it help me to solve a terrible problem.thank you!
Yes!
This is one of the most simplest and most useful plugin that I ever came across.
I’ve been waiting for this plugin for the longest time. Bloggers using language who do not care for alphabetical order would be down on their knees with appreciation.
Thank you!
If you like, I would be happy to translate this into Japanese. Just shoot me an email.
Cheers
Ooops.
I just found out that although you can reorder the sub-categories it can not cope with the sub-sub-categories.
Is there a work around this?
Thanks
@yoichi: Are you sure? Because I have tried with sub-categories, sub-sub-categories and even sub-sub-sub-categories… and it seems to work just fine.
Yeap. It just flips back to what it was before when I click the ‘order cateogries’ button. Strange … I tried both browsers FF and IE6 just in case.
Will the style sheet have any affect on this? Because I have the categories placed in the horizontal sub-navigation dropdown menu with IE6 and IE7 hacks.
Trying your plugin on WP2.5.1, i notice two things.
1. When clicking a more >> link (to order subcategories) the plugin assumes I have WP installed in root and does not recognize the subdir I have WP in. When manually repairing the URL, I see that the << back link has the same problem.
2. The plugin does not reorder my categories
… Am I missing something? I am not using widgets but the old wp_list_cats function in my sidebar. Is that the problem?
Thanks for any help. Your plugin seems to be just perfect for my needs and the ajax back-end is just wonderfully easy so I hope that this can be figured out
–ravan
Correction: I figured out why the categories were not reordered. I had the option ‘orderby=’ set in the wp_list_cats function. Removing it solved that issue. (you might want to put that in the installation description?)
Manually editing the subdir URL for changing any subcategory order is not a big deal so I have to report my contentment with your plugin. Thanks!
@RavanH: Thanks for pointing that out… I’ll make the necessary changes asap.
@RavanH: I have just updated the plugin to fix the problem related to WP being installed in a subdirectory. Thanks again for letting me know about this.
I find the NAVT plugin extremely useful for organizing my navigation menus.
Great plugin! It works fine, except that my subcategories are appearing as li elements with the main categories. Any suggestions? I have my categories tag as
wp_list_cats(’sort_column=name&hide_empty=0′
@jon: First, you should switch to wp_list_categories instead, since wp_list_cats has been deprecated.
Then, if you don’t want to list subcategories, I think you have to set the depth parameter to 1. Like: wp_list_categories(”depth=1″);
Thanks for the quick response! I switched to wp_list_categories. The problem is i want my subcats to show, but as new li items under the main category. WP was showing them like this before i installed the plugin. My current tag is wp_list_categories(’sort_column=name&hide_empty=1&hierarchical=1&title_li= any ideas?
@jon: So you want the subcategories to show but to be indented, is that what you’re asking? That might be related to your CSS. Probably this line: “ul ul {padding:0;}”
Hi, i just installed the orde category plugin and its great, but now the person i am building the site for want the sub categories on alha order, when i uninstalled/deactivated the plugin the order data was retained, how can i clear the data? and what is the default order when the plugin is active? seems to be post order, can i change this?
sorry for the typos…
…the order category …
…for wants the sub categories on alpha order…
p.s.: great plugin and thanks
@James: By default, without the plugin, the categories are ordered alphabetically. Right now the plugin doesn’t allow to order just the top level, unless you don’t touch the sub-categories order at all, in that case, I suppose the plugin should order the top level but not the sub-levels. I guess this would be a nice feature for future releases. Meanwhile, you can try removing the “wpguy_category_order” row from the wp_options table, re-enable the plugin and order just the top level categories.
thanks, i have already done that but the sub items are still ordering by ID/post order, and i can’t seem to make it do anything else
in the plug in
line 112
$allthecategories = get_categories(”hide_empty=0″);
124
$categories = get_categories(”hide_empty=0&child_of=$childrenOf”);
adding &orderby=name to either or both does nothing, that i can see
i also considered line 143
$categories[$n]->order = 99999;
replacing the 99999 with an ascii/hex conversion of the name string but i am new to php and have no idea how to do it, or if it would even work
the reason i am looking to do this is if i manually order the sub categories any time the user adds another sub category then i will need to reorder them, but the sub categories are all a year followed by a description
1931 some text
1967 some other text
1955 more text
when they are posted in that sequence they show up in that sequence whereas if they sequence automaticaly on the name they would be 1931 1955 1967, which would make more sense, and i would not need to manully resequence
i understand that this is case specific and do not excpect you to rewrite the plugin for one exception, just lookig for some guidance oin how i can alter the code to do what i need
Thanks again
ps - awesome follow-up, fast response time
Wessley, i don’t think it’s a CSS thing. The code is listing both the main and sub cats all as li under the main ul, instead of a li under the parent li. very strange behaior, i don’t know if it’s something in my WP installation that is causing it. I’ll troubleshoot it a bit more then get out of your hair. Thanks
CategoriesEvents
Artwork
Mardi Gras
General
Andrea Mistretta
sorry, tried to post the code but it didnt come thru. Andrea Mistretta is set up as a subbcat of artwork, but it gets put at the bottom of the main cat listing. thanks for looking.
@Jon: Try with wp_list_categories(”hierarchical=1″)
@James: Ok… It seems that, somehow, the categories get ordered by ID if you don’t specify an order… I have just updated the plugin to fix this, hopefully your problem will get solved with the update.
Wessley…
thanks very much for this change, works perfectly!
This new version has fixed the problem I was having with the sub-sub-categories.
Thanks!
When I try to save the category order I get logged out of the WP admin panel. The new category order is saved but I have login again. I use the latest version of this plugin and WP.
@yoichi: I’m really glad it’s working for you now
@Iliyan Darganov: That’s weird… I can’t think of anything that would cause this. Maybe it has something to do with some other plugin, I don’t know.
@Wessley Roche - maybe the problem is somewhere else. Is it possible to make this plugin compatible with qTranslate? Now it shows the language tags.
HI! Great plugin!!
I’ve managed to install it and it’s working well with my sidebar category list.
The problem is the listed posts aren’t sorted the same way. Is it possible to do?