Do you need to know how to exclude general access to certain pages or posts in areas of your site like your sitemap?
One of the easiest ways to do this is to filter your pages or posts by their unique ID.
Your WordPress Post ID is a unique identifier assigned automatically to every page or post you create.
Knowing how to find the page or post ID can be really useful if for example, you want to prevent pages from showing in your sitemap, or if you want only certain pages to display in the sidebar.
In this step-by-step tutorial, you are going to learn how to easily find the unique ID of pages and posts in your WordPress website.
- Finding A WordPress Post Or Page ID: Step-By-Step Tutorial
- WordPress Post/Page ID – When To Use
- Plugins – Page/Post IDs
Finding A WordPress Post Or Page ID: Step-By-Step Tutorial
To locate your page or post ID, log into your site’s dashboard and either go to the Pages screen (if you need to find the ID of a specific page) or the Posts section (if you need the ID of a specific post) …
(WP Dashboard – Pages Menu)
Locate the page or post that you want to know the ID of and hover your mouse over the title …
(Hovering over the post title displays Page or Post ID)
The unique “post ID” value is displayed in the status bar of your browser window. In the screenshot below, the ID is 5575 …
(Page ID displayed in your web browser)
Record the ID of the post or page.
WordPress Post/Page ID – When To Use
Here are a couple of examples of using WordPress post and page IDs:
Preventing Posts And Pages From Showing In A Site Map
Let’s say we would like to exclude a page whose ID is “26” from displaying to visitors on a site map.
Many site map plugins contain fields that let you specify the IDs of items you want to exclude (e.g. categories, pages, etc.) …
(Preventing pages or posts from appearing in a site map)
Exclude Pages And Posts From Appearing In The WordPress Sidebar
Another useful application for unique page IDs is to exclude them from displaying in the sidebar.
Simply 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 …
(Exclude posts or pages from displaying in your sidebar)
Preventing 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 the XML sitemap|sidebar)
Plugins – Page/Post IDs
If you need to regularly access the IDs of your posts or pages, then here are some plugins that you may find useful:
(Reveal IDs Plugin For WordPress)
This WordPress plugin displays IDs for pages, posts, categories, links, 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 …
(Posts Screen – ID Column)
To access the plugin settings go to Settings > Reveal IDs …
(WP Dashboard – Settings – Reveal IDs)
To learn more about this plugin, go here: WordPress Plugin – Reveal IDs
(99 Robots Show IDs – WordPress Plugin)
99 Robots Show IDs is another useful 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.
To learn more about this plugin, go here: 99 Robots Show IDs – WP Plugin
(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 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 where many IDs are required and the process of finding each ID would be time-consuming.
For more information about this plugin, go here: ID Arrays Plugin
Congratulations! Now you know how to find a page or post ID in a WordPress blog.
"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 association with WordPress or any of the products promoted on this site. We may derive financial benefits or affiliate commissions from the purchase of products and/or services mentioned on this website. All images and descriptions sourced from product websites remain the copyright of their respective owners and have been used only for illustrative or training purposes.
Have you found this tutorial useful? If so, please consider using the share buttons below to share this page with anyone thinking of starting their own business online.