How to view Post, Category, Tag, Comments or User ID in WordPress
WordPress is an excellent blogging platform. It became so popular that from coders to normal users, everyone is maintaining their own blog today using WordPress. For coders and techie guys it might be easy for them to do technical stuff in WordPress, but for normal people who don’t have much technical knowledge about WordPress, they might find it difficult to do some customizations in WordPress. At some point or other, in WordPress, we might want to know the post id, category id, tag id, comment id or user id. These details can be retrieved very easily but for non techie guys it might be a bit difficult for them to do so. So, I am going to show you how to view post, category, tag, comment or user id in WordPress.
WordPress uses MySQL database to store its data. Each post, comment, tag, category and user names are stored using unique ids. So that, each data can be retrieved using these unique ids from MySQL database.
How to Find a Page or Post ID in WordPress
To find a page or post id in WordPress, log into your WordPress admin panel.
Go to Posts tab and click on all posts
Now, select the post which you want to know the post ID of, and click on Edit
Now, after clicking on Edit button, an editor will open up and in the address bar, you can able to see the post ID of your desired post.
See below for screenshot
In my case, the post ID of the post which I am looking for is 1594. You can also know the page id of your desired page by following the above steps but all you have to do is, edit the page instead of post.
How to Find a Tag or Category ID in WordPress
Finding a tag, category ID or taxonomy ID in WordPress is similar to finding the post id or page id in WordPress. All you need to do is, follow the below steps.
Go to Posts tab and click on categories or tags.
Now, choose the category or tag you want to know the ID of and click on Edit button of the category or tag you want to know the ID. In the below example, I am taking WordPress category as an example.
After clicking on Edit button, in the address bar, you can able to view the category id or tag id of your desired category or tag.
As you can see in the above, I tried to retrieve category id of the category “WordPress” and in the address bar you can see tag_ID=28 which is my category id. You might confuse between tag id and category id as both appear as tag_ID in your address bar for both category and tag, because WordPress uses tag_ID name for all of its taxonomies.
Similarly, you can get tag id of your desired tag.
How to Find a Comment ID in WordPress
To find a comment ID in WordPress, follow the steps below
Log in to your WordPress admin panel and click on comments section in your left hand sidebar.
Now, click on Edit button of the comment which you wanted to know the comment ID.
Now, after clicking on the Edit button, an editor will open up and in the address bar, you will be able to see the comment id. See below for screenshot
As you can see in the above, my comment id is 2026. Similarly, you can find out the comment id of your desired comments.
How to Find a User ID in WordPress
Similar to the above procedures for finding comment id, post id and category id, you can also find the user id using the same method by editing the user profile.
Follow the procedure below
Go to Users tab and click on All Users.
Now click on edit button of the user you want to know the user ID of
After clicking on edit button, you can able to see the user id of the user you want in the address bar.
In the above, the user id of the user Peck
You can also find your own user id using the above procedure.
I hope, this article has helped you in some way or other, if you have any questions, please leave a comment below.