Ever wondered how to prevent specific posts and pages from displaying in areas of your site like your sitemap?
One of the easiest ways to do this is to filter your pages or posts by ID.
Your WordPress Post ID is a unique number assigned by WordPress automatically to every post or page you create.
Knowing how to locate the page or post 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 show in the Pages Widget.
In this step-by-step tutorial, you will learn how to easily locate your page or post ID in WordPress.
How To Find WordPress Post And Page IDs: Step-By-Step Tutorial
To find your page or post ID, log into your site and either go to the Pages area (to see page IDs) or the Posts section (if you want to find a post ID) …
(WP Dashboard – All Pages)
Locate the page or post that you would like to know the ID of and hover your mouse over the title …
(Hovering over the post title displays Page or Post ID)
The “ID” value is displayed in the status bar of your browser window. In the screenshot below, the post or page ID is 5575 …
(Page ID displayed in your browser)
Record the ID of the post or page.
Practical Uses For Post IDs/Page IDs
Here are a couple of practical ways to use WordPress post or page IDs:
Excluding Pages And Posts From Showing In Your Site Map
Suppose we need to prevent 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 items you want to exclude (e.g. categories, pages, etc.) …
(Prevent pages or posts from displaying in a site map)
Excluding Posts Or Pages From Showing In Your WordPress Sidebar
Another great use for page IDs is to prevent them from showing in your WordPress sidebar.
To do this, 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 pages or posts from showing in your WordPress sidebar)
Exclude Posts Or Pages From Displaying In A Sitemap
You can also use page and post IDs to exclude posts or pages from your XML sitemap …
(Exclude posts or pages from displaying in an XML sitemap|sidebar)
Plugins – Page IDs
If you would like to see all of your page or post IDs ”at-a-glance”, then here are a few FREE plugins that you may find useful:
(Reveal IDs Plugin For WordPress)
This plugin reveals the IDs for pages, posts, links, categories, 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 Menu – Reveal IDs)
Learn more about the plugin here:
(99 Robots Show IDs – WordPress Plugin)
99 Robots Show IDs is a free plugin that lets users view their posts, pages, media, links, tags, categories and users 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 Plugin For WordPress)
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 Post/Page 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 posts with many IDs required and finding IDs one by one would be time-consuming.
Learn more about this plugin here:
Congratulations! Now you know how to find the ID of a WordPress page or post.
"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum