How to Find Post, Page, Category, Comment and User ID in WordPress
An ID in WordPress represents a unique number that is used to classify specific items in the WordPress database. Almost every WordPress user needs this number at some point – usually cases where a WordPress theme or a plugin asks you about it in order to perform a particular function. The ID may also be required when you’re altering some code. Different pages, posts, categories, comments and users in WordPress all have their own ID, which is why we’ve decided to show you how you can find all these different ID types.
Finding a Post ID
There are two ways you can find a post ID in WordPress:
Finding a Page ID
Just like with the post ID, you can see the page ID by hovering on the page in the Pages list (Pages > All pages), or in the page’s URL.
Finding a Category ID
Like in the previous two cases, you can find the category ID you’re interested in by either hovering on the specific category in Posts > Categories and looking for the ID=number, or finding it in the category’s URL.
Finding a Comment ID
When you access the Comments screen from your Dashboard menu, you will be able to see the comment ID by hovering on the specific comment. The ID will be displayed as c=number.
Similarly to other instances, an alternative option is to click on the Edit button below the comment in question and view the comment ID in the URL.
Finding a User ID
As for the user ID, you can find it when you access Users > All Users, and hover on the Delete button under that particular user. The only user that has no Delete button is the Admin, and their ID is always the same (user_id=1).
Additionally, you can also view the user ID by clicking on their name.
Displaying IDs in WordPress Using the Show IDs Plugin
Despite it being fairly easy to find the ID in WordPress by using the methods discussed above, an even faster way to do it is to install the Show IDs plugin by 99 Robots. A great thing about this lightweight plugin is that once it’s installed, it will create an extra column in the lists of pages, posts, categories, comments and users. This column is where all the IDs will be displayed automatically, so there’s no need to configure anything within the plugin to make it work.
And there you have it – a simple way to find or display post, page, category, comment and user ID in WordPress. Even though the instances where you’ll need to find these IDs may not be so frequent, it’ll be useful to know how to do it once they occur. Plus, you now have a choice of different methods for obtaining the ID, so you can pick the one that works the best for you.