How to: find WordPress category ID

Some themes requires that you fill a form field with a category ID. It may be easy to find a category ID if you’re an advanced WordPres user, but what about beginners? Here’s a very simple manner to find any category ID.

Once you're logged in your WordPress dashboard, go to Manage and then in Categories.
Simply put your mouse cursor on the "edit" link related to the category you want to know the ID and look on your browser's status bar: As you can see on the screenshot below, 1 is the id of the category.

15 Responses

Jul 15 2011 15:19

Not interesting post, because it should be about “how to find category id in php” and not “how to find category id on your screen”. :)
The correct answer is:

global $wp_query;
$cat_ID = get_query_var('cat');

Jul 29 2011 23:44

No “web-developer” this post is exactly right, its about wordpress and an easy way to find a category ID, which was exactly what I needed. Not some string I have no idea where to place. Thanks anyway!

Jul 31 2011 09:27

Contrary to the cat with a melon on his head, I actually did find it useful… I always use slugs to navigate my wordpress site so when I had a theme asking for a category id I was stumped! thanks!

Aug 02 2011 18:25

How to get the Category ID numbers of single post?

Aug 03 2011 00:09

Thanks!!! this is what I was looking for. no haters!!!

Aug 08 2011 00:43

WP 3.2.1 doesn’t show cat_id in the url anymore. Follow the instructions above and look for tag_ID. Even though it says tag_id in the url, it is actually your category ID. Using the tag_id as my category ID just worked successfully in a query_posts.

-Steve

Aug 16 2011 05:35

Ah! Finally. Simple workaround. Thanks so much!

Aug 29 2011 08:04

Thanks! This post and Steve’s comment regarding 3.2.1 assisted me! You rock!

Sep 05 2011 00:25

Thanks to Author and Steve…
But still i wonder why the morons cant just display it along with the name, slug, etc. More prominently i mean.
sometimes, WP rocks… sometimes, it sucks!
Thanks again guys…

Sep 07 2011 18:53

@web-developer thank you for that code! Placing it in my theme’s category.php file helps me customize certain categories, especially since WP doesn’t allow “heavy-duty” HTML in the descriptions.

And thanks too @steve and @wprecipes. Sometimes the “simple” stuff is the easiest to overlook… ;)

Sep 26 2011 11:08

Heya, thank you for sharing. I already knew the trick written by Steve and WPrecipes… but the comment from web-developer helped me very well!

Now I can use in my createCat function the simple array to get all the posts with the easy stuff! Yus, I am getting rid of the silly loop ;)

global $wp_query;
$cat_ID = get_query_var(‘cat’);
$args = array(‘category’ => $cat_ID);
$posts_array = get_posts($args);

Nov 05 2011 21:54

Thanks… just what I needed!

Dec 03 2011 03:57

This was very helpful, so thank you! Also, your kitty graphics are adorable. :)

Jan 12 2012 06:31

Thanks so much!

Jan 26 2012 19:21

@webdev – to me this is the most interesting post of the day… helped me find the blog id in a wpmu.

@wprecipes – TY!

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required