WordPress For Non-Techies: Free WordPress Tutorials – WPCompendium.org

How To Find Your WordPress Page And Post IDs

For a white label version of this tutorial visit WPTrainingManual.com.

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.

Select Pages – All Pages

This brings you to the 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.

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.

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.

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.

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.

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.

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.

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?

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.

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’?

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…

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

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.

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:

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.

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.

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.

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

99 Robots 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 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.

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

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.

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.

Learn how to find your Post or Page IDs.

***

"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now

***

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.

For a white label version of this tutorial visit WPTrainingManual.com.