Do you need to know how to prevent public access to certain posts and pages in areas of your site like your sitemap?
Often, the easiest way to do this is to filter your pages or posts by ID.
Your WordPress Page ID is a unique identifier assigned to every post or page created on your site.
Knowing how to find a page or post ID can be useful if, for example, you want to prevent pages from showing in your WordPress sitemap, or if you want only selected pages to show in the Pages Widget.
In this tutorial, you are going to learn how to locate page and post IDs in WordPress.
How To Locate A Page Or Post ID In Your WordPress Site: Tutorial
To find your page or post ID, log into your site’s dashboard and either go to the Pages area (to find IDs of pages) or the Posts screen (to see IDs of posts) …
(WP Dashboard – WordPress Pages Menu – All Pages)
Find the page or post that you would like to know the ID of and hover your mouse over its title …
(Hovering over the post title displays Post ID)
The “ID” value is displayed in the status bar of your web browser. In the screenshot below, the ID is 5575 …
(Page ID displayed in your browser)
Write down the ID of the post or page.
Practical Applications For Page ID/Post ID
Here are a few practical ways to use post and page IDs:
Excluding Posts And Pages From Appearing In A Site Map
Suppose you would like to exclude a page whose ID is “26” from displaying to visitors on a site map.
Site map plugins typically contain fields that let you specify the IDs of items you want to exclude (e.g. categories, pages, etc.) …
(Excluding pages and posts from displaying in a site map)
Excluding Posts Or Pages From Appearing In The WordPress Sidebar
Another useful application for page IDs is to exclude them from displaying in your WordPress sidebar.
Just enter all of the WordPress Page IDs for the pages you want to exclude separated by commas into the Exclude field of the Pages widget, and click the Save button …
(Preventing posts and pages from displaying in the WordPress sidebar)
Excluding Pages Or Posts From Showing In A Sitemap
You can also use page and post IDs to exclude pages or posts from your XML sitemap …
(Preventing pages or posts from displaying in an XML sitemap|sidebar)
WordPress Plugins – Page IDs
If you need to regularly access the IDs of all your posts or pages, then here are a few FREE WordPress plugins that you may find useful:
(Reveal IDs WP Plugin)
This free plugin reveals IDs for posts, pages, links, categories, media, users, comments, link categories, custom post types, custom taxonomies and tags. It also adds a sortable column header to your Pages and Posts tables …
(Posts Area – ID Column)
You can access the plugin settings area by going to Settings > Reveal IDs …
(Settings Menu – Reveal IDs)
To download this plugin, go here:
(99 Robots Show IDs – WordPress Plugin)
99 Robots Show IDs is another useful plugin that displays your pages, posts, media, links, tags, categories and users in the Posts and Pages admin tables. It’s also a super lightweight plugin that supports custom post types and taxonomies.
Download this plugin here:
(ID Arrays – WordPress Plugin)
ID Arrays not only adds a column of IDs to your Table of Posts/Pages, it also provides a 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 where many IDs are required and the process of finding each ID would be time-consuming.
To download this plugin, go here:
Congratulations! Now you know how to locate the unique ID of pages and posts in WordPress.
"Your training is the best in the world! It is simple, yet detailed, direct, understandable, memorable, and complete." Andrea Adams, FinancialJourney.org