Sometimes you just need to know the page ID or post ID in WordPress, whether it’s for a plugin, widget, or something else. Maybe instead you need a tag ID or a category ID.
Either way, it’s so amazingly easy to find you’ll be surprised.
Finding the WordPress Page ID or Post ID
Go to Posts or Pages, depending on what ID you’re after.
This part varies based on your browser, but if you hover your mouse over a page or post title then in the bottom left (in Chrome) you should see a URL shown.
If you look at that URL then you will see a part that looks like post=668, where the number will be the ID of the page or post you’re after.
So, in my example, the post ID is 668.
If you’re having a hard time finding the URL when you hover over a page or post then do this.
Go to your list or pages or posts and click on the one you need the ID for.
Now, look at the URL in your browser’s address bar. You should see something like I noted above with post=668.
You can see from the screenshot exactly what I’m talking about. Again, in my example the post ID is 668.
Bonus Tip: Custom Post Type ID
This format holds true for other things in WordPress, such as custom post types. A custom post type is still a post inside WordPress, so it follows the same structure when needing to find an ID.
Finding the Category ID or Tag ID
The same method is true for finding the category ID or a tag ID in WordPress. The only difference is the parameter preceding the ID.
So, for a post you looked for post=668, but for a category or tag you’re looking for tag_ID=13, or whatever number comes after tag_ID.
Note that tag_ID is the same parameter used for a category too, in case you’re curious.
In the List
Same as before, if you hover over the name of a tag or category then you should see a URL info box appear in the bottom left (depending on your browser).
Look in the URL for tag_ID and find your ID after it.
If you aren’t seeing the URL info box then click on the tag or category to edit it and look in the URL for tag_ID.
Plugins for IDs
Now, you could install a plugin to show you a page ID, post ID, tag ID, or category ID, but really there’s no need.
Every plugin you install in WordPress will slow it down, so there’s no need to slow things down over something as simple as this.
The next time you need a page ID or a post ID then just remember to look in the URL and you’ll find your answer.