This solution is for self-hosted WordPress sites, not wordpress.com websites.
It’s not obvious where to find post and page IDs, but once you know where to look it only takes a second.
Here’s where to look…
How to Find a Page ID in WordPress
First, login to your site and visit the Pages menu in your admin dashboard. Then, click on the Page that you need an ID for.
Now in the edit screen, look at the URL in your web browser. You’ll see “?post=XX” where “XX” is the ID of the post or page you’re looking at.
In this example below, the page’s ID is 61.
To find the ID of any post or page, navigate to the editor for that post/page and you’ll always find the ID in the URL after the “?post=” text.
I used a page in my example, but you can use this same trick to find a post ID, category ID, or tag ID in the WordPress dashboard. Visiting the Edit page for any category or tag will work the same way in that the ID will be in the URL.
How to Quickly Find Many Page/Post IDs
Now you know where to look when you need to find an ID. However, if you find yourself looking for IDs often, you may want a faster method.
In this case, check out the Reveal IDs plugin. It makes finding IDs a bit easier because it displays the Post and Page IDs in the admin menus. This can save you a lot of time if you need to get IDs from many Posts or Pages.