How To Find Your WordPress Page And Post IDs

Learn how to easily find a WordPress post or page ID and why knowing how to locate your post and page IDs can be useful …

How To Find Your WordPress Page And Post IDs

In this tutorial, you will learn how to easily find your WordPress Page and Post IDs and why knowing this information is useful.

The following tutorials will help you gain a better understanding of the topic covered in this tutorial:

Why Is Knowing Page IDs/Post IDs Useful?

WordPress assigns a unique ID to every page, post, custom post type (e.g. a product page), and taxonomy (e.g. categories and tags) on your site. This unique ID is stored on your WordPress database.

Knowing how to find the unique ID of a post or page can be quite useful if, for example, you want to filter out or exclude certain pages from displaying on sections of your site like your sitemap, or conversely, if you want to display only selected posts or pages on lists, tables, sidebar widgets (e.g. the Pages widget), etc.

How To Locate The ID Of  Any Post Or Page In WordPress

To locate the ID of a post or page, log into your WordPress admin area and either go to the Pages or the Posts screen, depending on which type of ID you are searching for.

For this example, let’s say we are looking for the ID of a specific page, so we need to go to the Pages screen. From the main menu, select Pages > All Pages.

WordPress Menu: Pages - All Pages
Select Pages – All Pages

This brings you to the Pages screen.

WordPress Pages Screen
Pages screen.

Locate the page (or post) that you are searching for (and want to know the ID of), and hover over the title.

Selected Page or Post
Hover over the selected post or page to view its ID.

The unique ID value of the page (or post) will be displayed in the status bar of your web browser. In our example, the page ID is 171.

Page ID
Your browser displays the Post or Page ID.

You can also view your Page or Post ID in the URL field (i.e. the web address bar) at the top of your web browser when editing a post or page.

Page ID displayed in URL field of web browser.
Your Post/Page ID displays on the URL field of your web browser.

If you plan to use this ID for a specific purpose (e.g. to exclude this page from showing on a list or site map), make a note or write down this ID number.

WordPress Post & Page ID – Practical Uses

Let’s go through some of the practical applications of knowing how to find the unique ID of your posts or pages:

Exclude Posts Or Pages Displaying On Your Visitor’s Site Map

You may have created some pages (or posts) on your site that you don’t want your visitors to know about or to easily find when looking at your site map. For example, an unprotected download or thank you page or a page containing a special offer for a selected group of users.

Many site map plugins include a section that lets you exclude pages, posts, or categories from displaying to visitors by simply entering their IDs into a field.

Exclude Pages field
Use IDs to exclude Posts and Pages from your HTML site map.

Exclude Pages  From  Displaying On Your Sidebar

Another useful application for unique Page IDs is to prevent these from displaying in the Pages Widget on the sidebar area of your site.

Just type in, paste, or enter all of the Page IDs you want to exclude separated by commas into the Exclude field of the Pages widget and click the Save button to update your settings.

Page Widget - Exclude field.
Exclude Pages from your Pages widgets by inputting their IDs.

Display Selected Posts or Pages Only

Conversely, you may only want selected posts or pages to appear on a list (for example, a list of featured posts, pages, or products).

For example, here is a screenshot of a WordPress plugin called Content Views that lets you create custom lists by including only selected posts and pages using different filters, such as their unique IDs.

Post IDs used to build a custom list.
Some WordPress plugins let you build custom lists using Posts or Page IDs.

Exclude Posts Or Pages From Your XML Sitemap

Like site maps for visitors, some SEO plugins let you exclude posts or pages from your site that you don’t want search engines to easily find from your XML sitemap by entering their IDs into an ‘Exclusion’ field.

Sitemap Exclusions
Exclude Posts and Pages from your XML sitemap by entering their IDs.

Quickly Find Posts, Pages, Or Custom Post Types By Replacing IDs On your Browser

Here’s something very handy to know about the way WordPress uses unique IDs for almost everything:

You can load any post, page, or custom post type on your web browser by replacing the ID value of another item’s URL and refreshing your browser.

Let’s show you what this means and how useful this can be if a situation like the example shown below should ever arise.

Here is a post containing a shortcode used to display a list. This shortcode, however, includes only the unique ID of the list item (‘188013’). Let’s say that we need to edit the items included in this list. How can we find out which list this post is using?

Example of a post using a custom post type shortcode
The shortcode inserted into this post uses only an ID number. How can we find out what list is being used here?

Let’s see why this is a problem…

First, let’s copy the list item number to our clipboard and paste it into a plain text file as we’ll be using this ID in a moment.

Plain text file with item number
Copy the list ID number and paste it into a plain text file.

The site in this example uses a custom post type called “Lists,” which is not a default feature of WordPress (i.e. someone created this feature for the site owners.)

If we go to the Lists screen on this site, we can see that they have created over 650 list entries. We need to edit list number ‘188013.’

Which of these lists is number ‘188013’?

Lists screen.
This site has over 650 lists. Which list is number ‘188013’?

Fortunately, you don’t have to hover over the title of every item on this screen until you find list item number ‘188013’. There is a much easier simpler, easier, and faster way.

Here’s how to easily find the list we’re looking for:

Just click the Edit link of any item on the screen…

Lists screen - Edit link
Click the Edit link of any item on this screen.

This will load the item into your web browser. Note the item’s ID number is included in its URL. In this case, the ID of this list item is 152076

List item URL with unique ID highlighted.
The unique ID of this list item is 152076.

All you have to do is replace the ID in this URL with the ID that you’ve previously copied to your clipboard and hit the Enter key to refresh your browser.

The item you were searching for will then be loaded on your screen and you can now view, edit, or work on it.

Screenshot of List item with correct ID number in URL.
We’ve found the list item with unique ID 188013…hurrah!

WordPress Plugins – Page/Post} IDs

If you work with Page or Post IDs on a regular basis, it’s a good idea to install a plugin that will give you quick access to these IDs.

If you search for terms like “reveal ID,” “show post ID,” etc. in the Add Plugins screen (Plugins > Add Plugins), you will find a number of plugins that can perform this function:

Plugins results for search on reveal ID.
A number of plugins are available that can easily display your Post or Page IDs.

Here are just some of the plugins you can use:

Most of these plugins perform a similar function — they add a column to your table of Posts and Pages displaying the item’s ID.

Let’s go through some of these plugins so you can see exactly what they do.

Reveal IDs

Reveal IDs.
Reveal IDs.

This free plugin displays the IDs for posts, pages, categories, tags, media, users, comments, links,  link categories, custom taxonomies, and custom post types. It also adds a sortable column header to your table of Posts and Pages.

Table of Posts with ID Column added.
The plugin adds an ID column to your Table of Posts.

You can view all the plugin’s settings by going to Settings > Reveal IDs.

Settings menu - Reveal IDs.
Settings menu – Reveal IDs.

For more information about this plugin, go here:  Reveal IDs

99 Robots Show IDs

Show IDs.
Show IDs.

99 Robots Show IDs is another useful plugin that displays your posts, pages, media, links, categories, tags, and users in the Posts and Pages admin tables. It’s also very lightweight and supports custom post types and taxonomies.

For more information about this plugin, go here: 99 Robots Show IDs

ID ARRAYS

ID Arrays.
ID Arrays.

ID Arrays adds a column of IDs to your Table of Posts and Pages and provides a useful function that lets you copy a list of selected Post and Page IDs to your clipboard.

Table of Posts with Post ID copy functionality.
ID Arrays displays an ID column and adds a function that lets you copy the IDs of selected posts.

This is useful if you are working with a long list of posts or pages where noting down each ID separately would be very time-consuming.

For more information about this plugin, go here: ID Arrays

tip

If you have installed a plugin to display your page or post IDs and cannot see the ID column in the Post or Page screens, open the Screen Options tab and make sure that the ID column checkbox is selected.

Screen Options tab - ID checkbox.
Check your Screen Options tab to make sure that the ID checkbox is selected.

Congratulations! Now you know how to easily find post and page IDs in WordPress.

Table of Posts with ID Column.
Learn how to find your Post or Page IDs.

***

"I was absolutely amazed at the scope and breadth of these tutorials! The most in-depth training I have ever received on any subject!" - Myke O'Neill, DailyGreenPost.com

***

We are not affiliated, associated, sponsored, or endorsed by WordPress or its parent company Automattic. This site contains affiliate links to products. We may receive a commission for purchases made through these links.