Black Friday50% off every Pro template and membership with code50% off with Ends in 05days15hrs54min05secShop the sale →

How to Get Post, Category, Tag, Comments, or User ID in WordPress

Are you wondering how to get post, category, tag, comments, or user ID in WordPress easily? This article will give you a step-by-step guide. Let’s check it out. What Is the ID of a WordPress Post, Category, Tag, Comment, or…

How to Get Post, Category, Tag, Comments, or User ID in WordPress

Are you wondering how to get post, category, tag, comments, or user ID in WordPress easily? This article will give you a step-by-step guide. Let’s check it out.

What Is the ID of a WordPress Post, Category, Tag, Comment, or User?

The ID is a unique number that is created when you upload, publish, or create any item in WordPress. This ID is used to query, identify and read the item for display from the database. Almost everything has an ID, such as posts, pages, categories, tags, users, media uploads, menus, and comments.

Sometimes, you will need to find an ID number to enable or disable certain functions in WordPress themes and plugins that you are using.

How to Find Your Post ID/Page ID?

In WordPress, you can use posts and pages to add rich content to your website. Sometimes, you may want to filter your posts and pages. In such a situation, you may need to get your post and page IDs. In order to find a post ID in WordPress, you can follow the steps below.

First of all, go to the Posts > All Posts page. And then, hover your mouse over the post title whose ID you want to get.

You will see the post edit URL displayed at the bottom left-hand corner of the current page. Now, have a look at the number that appears between ” post=” and “&action“. This number is the ID of the post.

In our example, 535 is the WordPress post ID.

image1

In addition, you can also see your WordPress post ID by opening this post to edit. The post edit URL will be displayed in your browser’s address bar.

get post category tag comments

Similarly, if you want to find your WordPress page ID, you can easily use this method. However, you first have to go to the Pages > All pages in your dashboard instead of posts.

As shown in the screenshot below, the ID of the About page is 255.

get post category tag comments

How to Find Your Category ID and Tag ID?

In WordPress, categories and tags play a crucial role in grouping and sorting your content. Thanks to that, readers will quickly find the content they are looking for.

In some cases, you may need to get a category and tag ID to add a plugin feature. Getting a WordPress category ID or tag ID is no different from finding a post ID.

Just go to Posts > Categories from your dashboard. Then, you will see a list of your categories, hover your mouse over the category title whose ID you want to find.

After that, the category edit URL will be displayed in a popup box at the bottom of your screen.

Now you can see the category edit URL appear on a popup box at the bottom left corner of your screen.

Your category ID is located between “category&tag_ID=” and “&post_type“.  In our example, the WordPress category ID is 33.

get post category tag comments

Moreover, you can click on the Edit link below the category title, and you will see the same URL that appeared at the bottom of the screen when you hovered your mouse over the category title.

image5

Now, you can find the tag ID by using the same process that you did to get post/ page and category IDs. Go to Posts > Tags, then hover your mouse over the tag title to get the tag ID that will appear at the bottom of the screen.

In the URL, the special number between “tag&tag_ID=” and “&post_type” is the tag ID.

As shown in the screenshot below, the tag ID is 42.

get post category tag comments

How to Find a Comment ID?

If you want to find a comment’s ID, you just go to the Comments section from your dashboard. Then, you will see a list of comments on your site.

Hover your mouse over the Edit link under the comment whose ID you want to get. You will immediately see the comment edit URL at the bottom of the screen.

The WordPress comment ID is displayed at the end of the URL, after the “editcomment&c=“. In the below screenshot, our comment ID is 434901.

Just like posts, pages, categories, and tags, you can open the comment editor page to see your comment ID in your browser’s address bar.

get post category tag comments

How to Find a User ID?

To find a user ID, you just go to the Users > All Users page in your WordPress admin panel. Then hover your mouse over the user name whose ID you want to find. WordPress will display the user edit URL at the bottom left corner of your screen.

The user ID will be right between “user_id=” and ” &wp” . In our case, the User ID is 2.

image8

Additionally, you can click on the Edit link under a user name to see the user ID in the browser’s address bar.

image9

Final Words

We have provided you with the simplest method to get post, category, tag, comments, and user ID in WordPress. We hope this article has solved your problems as well as gave you a lot of useful information. In case you have any questions, please leave a comment below; we are happy to help you as soon as possible.

Moreover, do you already own a beautiful and professional website? If not, don’t miss our Free WordPress Themes to explore a wide range of amazing designs.

Build it with a template

Start from a finished design: Joomla templates, WordPress themes or the AI-ready block themes. Every template has a free version and a live demo.

Free download

We'll send the link, setup tips and update notices, and you can reach us anytime through our AI assistant and contact form.

The download starts at once. We email you the link and ask you to confirm your address. Privacy policy.