Do you need to know how to exclude specific pages and posts from appearing 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 Or Page ID is a unique identifier that WordPress assigns automatically to every post or page created on your site.
Knowing the page or post ID can be 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 sidebar section of your site.
In this tutorial, you will learn how to find page and post IDs in your WP website.
- 1 How To Find WordPress Post And Page IDs: Step-By-Step Tutorial
- 2 WordPress Post Ids/Page IDs – Practical Uses
- 3 WP Plugins – Page/Post IDs
How To Find WordPress Post And Page IDs: Step-By-Step 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 screen (if you want the ID of a specific page) or the Posts screen (if you need the ID of a post) …
(WP Dashboard – All Pages)
Find the page or post that you would like to know the ID of and hover your mouse over the title …
(Hovering over the title reveals Post ID)
The “ID” value is displayed in the status bar of your browser window. In the image below, the post or page ID is 5575 …
(Page ID displayed in your browser)
Record the ID of the page or post.
WordPress Post Ids/Page IDs – Practical Uses
Here are some examples of using WordPress page and post IDs:
Exclude Posts And Pages From Displaying In A Site Map
In the example below, let’s say that you would like to exclude a page whose unique ID is “26” from displaying to visitors on a site map.
Many site map plugins include fields that let you specify the IDs of items you want to exclude (e.g. categories, pages, etc.) …
(Preventing pages or posts from showing in a site map)
Prevent Pages And Posts From Showing In Your WordPress Sidebar
Another practical use for page IDs is to prevent them from displaying in the sidebar section of your web site.
Just enter all of the WordPress Page IDs for the pages you want to exclude separated by a comma into the Exclude field of the Pages widget, and click the Save button …
(Preventing pages or posts from displaying in your WordPress sidebar)
Exclude Posts And Pages From Showing In A Sitemap
You can also use page and post IDs to exclude pages or posts from your site’s XML sitemap …
(Excluding posts and pages from appearing in your XML sitemap|sidebar)
WP Plugins – Page/Post IDs
If you would like to know the IDs of your posts or pages inside your admin area when you log in, then here are a few FREE plugins you may find useful:
(Reveal IDs – WordPress Plugin)
This free plugin displays the IDs for posts, pages, categories, links, media, users, link categories, comments, 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 option by going to Settings > Reveal IDs …
(Settings – Reveal IDs)
Learn more about the plugin here: Reveal IDs
(99 Robots Show IDs Plugin For WordPress)
99 Robots Show IDs is a free plugin that displays your pages, posts, links, media, users, categories and tags in the Posts and Pages admin tables. It’s also a very lightweight plugin that supports custom post types and taxonomies.
Learn more about the plugin here: 99 Robots Show IDs – WP Plugin
(ID Arrays WP Plugin)
This plugin 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 lets you 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 with many IDs required and finding each ID would be time-consuming.
To learn more about this plugin, go here: ID Arrays – WordPress Plugin
Congratulations, now you know how to locate the unique ID of WordPress pages and posts.
"I was absolutely amazed at the scope and breadth of these tutorials! The most in-depth training I have ever received on any subject!" - Myke O'Neill, DailyGreenPost.com
Disclaimer: This site has no association with WordPress or any of the products written about on this website. We may derive a financial benefit or affiliate commission from sales of any services and/or products mentioned on our website. All images remain the copyright of their respective owners and have been used only for illustrative or training purposes.
Did you enjoy this article? If so, please consider sharing this information with anyone thinking of starting their own business online using the share buttons below.