Do you need to know how to exclude public viewing of specific pages and posts in areas of your site like your sitemap?
Often, the easiest way to do this is to filter your pages or posts by their unique ID.
Your WordPress Post ID is a unique identifier assigned by WordPress to every page or post that you create on your site.
Knowing how to find a post or page ID can be very useful if, for example, you want to prevent pages from showing in your sitemap, or if you want only certain pages to display in your sidebar.
In this step-by-step tutorial, you will learn how to easily locate the unique ID of WordPress posts and pages.
How To Locate A Page Or Post ID In WordPress: Tutorial
To locate your page or post ID, log into your site and either go to the Pages section (to see IDs of pages) or the Posts area (if you need to find a particular post ID) …
(WP Dashboard – All Pages)
Find the page or post that you want to know the ID of and hover your mouse over the title …
(Hover over the title to display Page or Post ID)
The unique “post or page ID” value is displayed in the status bar of your web browser. In the example below, the post ID is 5575 …
(Page ID displayed in your browser)
Record the ID of the page or post.
Page/Post IDs – What Can It Be Used For?
Here are a few practical uses for WordPress post and page IDs:
Preventing Pages And Posts From Appearing In A Site Map
In the example below, let’s say that you want to exclude a page whose ID is “26” from displaying to visitors on a site map.
Site map plugins typically include fields that let you specify the IDs of excluded items (e.g. categories, pages, etc.) …
(Exclude pages and posts from appearing in a site map)
Excluding Posts And Pages From Appearing In Your WordPress Sidebar
Another great use for page IDs is to prevent them from appearing in the sidebar.
To do this, simply enter all of the Page IDs for the pages you want to exclude separated by commas into the Exclude field of the WordPress Pages widget, then click the Save button …
(Exclude posts and pages from displaying in your WordPress sidebar)
Prevent Pages Or Posts From Appearing In Your XML Sitemap
You can also use post and page IDs to exclude pages or posts from your site’s XML sitemap …
(Prevent posts and pages from displaying in the XML sitemap|sidebar)
Plugins – Page/Post IDs
If you want to see the IDs of all your pages or posts inside your admin area when you log in, then here are some WordPress plugins you may find useful:
(Reveal IDs – WordPress Plugin)
This free WordPress plugin displays IDs for posts, pages, categories, links, users, media, link categories, comments, custom taxonomies, custom post types and tags. It also adds a sortable column header to your Pages and Posts tables …
You can access the plugin settings option by going to Settings > Reveal IDs …
(Settings – Reveal IDs)
To download this plugin, go here:
(99 Robots Show IDs)
99 Robots Show IDs is another plugin that lets users see their posts, pages, links, media, categories, users and tags in the Pages and Posts admin tables. It’s also a very lightweight plugin that supports custom post types and taxonomies.
Download this plugin here:
ID Arrays not only displays a column of IDs in your Table of Posts/Pages, it also provides a very useful function that lets you copy a list of selected Post/Page IDs to your clipboard.
(ID Arrays allows you to select and copy a list of Page/Post IDs to your clipboard)
This can be very useful if, for example, you are working with a long list of pages with many IDs required and finding each ID would be time-consuming.
Download the plugin here:
Congratulations, now you know how to locate a post or page ID in a WP site.
"If you're new to WordPress, this can stand on its own as a training course and will stay with you as you progress from beginner to advanced and even guru status." - Bruce (Columbus, Ohio)