Ever wondered how to prevent certain posts and pages from displaying in areas of your website 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 page or post created on your site.
Knowing how to locate the page or post ID is really useful if for example, you want to exclude pages from showing in your sitemap, or if you want only certain pages to display in the sidebar section of your site.
In this step-by-step tutorial, you will learn how to find the unique ID of pages and posts in WordPress.
Finding The WordPress Post Or Page ID: Tutorial
To find your page or post ID, log into your site and, depending on which ID you are trying to locate, either go to the Pages section (if you need to find page IDs) or the Posts screen (if you need to find a particular post ID) …
(WP Dashboard – Pages Menu)
Select 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 reveals Post ID)
The unique “page or post ID” value is displayed in the status bar of your browser window. In the example below, the post or page ID is 5575 …
(Page ID displayed in your web browser)
Note down the ID of the post or page.
Practical Uses For Page/Post ID
Here are a couple of practical uses for WordPress page or post IDs:
Prevent Pages Or Posts From Displaying In A Site Map
In the example below, we want to prevent a page whose ID is “26” from displaying to visitors on a site map.
Most site map plugins contain fields that let you specify the IDs of items you want to exclude (e.g. categories, pages, etc.) …
(Excluding posts and pages from appearing in a site map)
Excluding Pages And Posts From Showing In The Sidebar
Another useful application for page IDs is to exclude them from showing in your WordPress sidebar.
Simply 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 posts and pages from appearing in the WordPress sidebar)
Prevent Posts And Pages From Displaying In Your Site’s Sitemap
You can also use page and post IDs to exclude posts or pages from your site’s XML sitemap …
(Exclude pages or posts from displaying in an XML sitemap|sidebar)
WP Plugins – Page IDs
If you want to regularly access your post or page IDs, then here are some plugins that you may find useful:
This WordPress 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 Posts and Pages tables …
You can access the plugin settings by going to Settings > Reveal IDs …
(Settings Menu – Reveal IDs)
For more information about this plugin, go here:
(99 Robots Show IDs WordPress Plugin)
99 Robots Show IDs is a free plugin that lets users view their posts, pages, media, links, users, tags and categories in the Pages and Posts admin tables. It’s also a super lightweight plugin that supports custom post types and taxonomies.
To download this plugin, go here:
(ID Arrays WordPress Plugin)
ID Arrays not only adds a column of IDs to 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 posts where many IDs are required and finding IDs one by one would be time-consuming.
Download this plugin here:
Congratulations, now you know how to easily locate the WP post or page ID.
"Learning WordPress has been a huge stumbling block for me. I've been looking for something that covers absolutely everything but doesn't cost an arm and a leg. Thank you so much ... you have just provided me with what I have been looking for! Truly appreciated!" - Tanya