Ever wondered how to exclude general access to certain pages or posts in areas of your website 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 number that WordPress assigns automatically to every page or post you create.
Knowing your post or page ID can be quite useful if, for example, you want to exclude pages from showing in your WordPress sitemap, or if you want only certain pages to display in the Pages Widget.
In this tutorial, you will learn how to locate the unique ID of WordPress posts and pages.
How To Locate The Unique ID Of WordPress Pages And Posts: Tutorial
To locate your page or post ID, log into your site’s dashboard and, depending on which ID you are trying to locate, either go to the Pages section (if you want page IDs) or the Posts area (to see post IDs) …
(WP Dashboard – WordPress Pages Menu – All Pages)
Locate the page or post that you want to know the ID of and hover your mouse over the title …
(Hovering over the page title reveals Post ID)
The “ID” value is displayed in the status bar of your web browser. In the screenshot below, the post ID is 5575 …
(Page ID displayed in your browser)
Note down the ID of the post or page.
Post IDs/Page IDs – Practical Applications
Here are some practical ways to use page and post IDs:
Excluding Pages Or Posts From Showing In Your Site Map
In the example below, let’s say that you want to prevent a page whose ID is “26” from displaying to visitors on a site map.
Most site map plugins include fields that let you specify the IDs of excluded items (e.g. categories, pages, etc.) …
(Excluding posts and pages from showing in a site map)
Exclude Posts Or Pages From Displaying In The Sidebar
Another great use for page IDs is to exclude them from appearing in your sidebar.
To do this, just enter all of the WordPress Page IDs for the pages you want to exclude separated by commas into the Exclude field of the WordPress Pages widget, and click the Save button …
(Preventing pages or posts from displaying in the WordPress sidebar)
Prevent Pages And Posts From Showing In Your Site’s Sitemap
You can also use post and page IDs to exclude posts or pages from your XML sitemap …
(Preventing posts and pages from displaying in your XML sitemap|sidebar)
Plugins – Page/Post IDs
If you need to know your post or page IDs ”at-a-glance”, then here are a few FREE WordPress plugins you may find useful:
This WordPress plugin displays IDs for pages, posts, links, categories, users, media, 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 by going to Settings > Reveal IDs …
(Settings – Reveal IDs)
Learn more about the plugin here:
(99 Robots Show IDs WP Plugin)
99 Robots Show IDs is another plugin that lets users see their pages, posts, links, media, tags, users and categories in the Pages and Posts admin tables. It’s also a very lightweight plugin that supports custom post types and taxonomies.
To download this plugin, go here:
(ID Arrays Plugin)
ID Arrays not only displays a column of IDs in your Table of Pages/Posts, it also provides a very useful function that lets you copy a list of selected Page/Post IDs to your clipboard.
(ID Arrays allows you to select and copy a list of Post/Page 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 IDs one by one would be time-consuming.
To download this plugin, go here:
Congratulations! Now you know how to easily locate the unique ID of a WordPress page or post.
"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)