Do you need to know how to prevent specific pages or posts from showing 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 Or Post ID is a unique identifier assigned by WordPress automatically to every post or page you create on your site.
Knowing the page or post ID is really useful if for example, you want to prevent pages from displaying in your sitemap, or if you want only selected pages to display in the Pages Widget.
In this tutorial, you are going to learn how to locate the WordPress post or page ID.
- How To Find The Page Or Post ID In Your WP Website: Tutorial
- WordPress Post ID / Page ID – What Can It Be Used For?
- Plugins – Page/Post IDs
How To Find The Page Or Post ID In Your WP Website: Tutorial
To locate the unique ID of any page or post, log into your site’s admin and, depending on which ID you are trying to locate, either go to the Pages area (to find a page ID) or the Posts area (to find the ID of a particular post) …
(WP Dashboard – WP Pages Menu – All Pages)
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 Page or Post ID)
The “ID” value is displayed in the status bar of your browser window. In the image below, the ID is 5575 …
Record the ID of the page or post.
WordPress Post ID / Page ID – What Can It Be Used For?
Here are a few examples of using page and post IDs:
Preventing Pages Or Posts From Showing In Your Site Map
In the example below, let’s say that you would like 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 pages or posts from displaying in your site map)
Exclude Posts Or Pages From Appearing In The Sidebar
Another practical use for page IDs is to exclude them from appearing in your WordPress sidebar.
Simply enter all of the Page IDs for the pages you want to exclude separated by commas into the Exclude field of the WordPress Pages widget, then click the Save button …
(Preventing pages and posts from displaying in your WordPress sidebar)
Preventing Pages Or Posts From Displaying In An XML Sitemap
You can also use post and page IDs to exclude pages or posts from your XML sitemap …
(Exclude pages and posts from appearing in your XML sitemap|sidebar)
Plugins – Page/Post IDs
If you would like to regularly access your post or page IDs, then here are a few FREE WordPress plugins you may find useful:
This free 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 Posts and Pages tables …
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)
99 Robots Show IDs is another useful plugin that displays your posts, pages, media, links, tags, users and categories in the Posts and Pages admin tables. It’s also a super lightweight plugin that supports custom post types and taxonomies.
To download this plugin, go here:
(ID Arrays WP Plugin)
ID Arrays not only adds a column of IDs to your Table of Pages/Posts, it also provides a 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 IDs one by one would be time-consuming.
Learn more about this plugin here:
Congratulations, now you know how to easily find the ID of a page or post in WordPress.
"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now
Disclaimer: This site has no direct association with WordPress or any WordPress products written about on this website. We may derive financial benefits from purchases of third-party products and/or services advertised on our site. All images are the copyright of their respective owners and have been used solely for illustrative or training purposes.
Was this tutorial useful? Please feel free to share this information with other website owners using the share buttons below.