Ever wondered how to prevent general access to certain pages and posts in areas of your website 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 identifier assigned to every page or post created on your site.
Knowing your page or post ID is quite useful if, for example, you want to prevent pages from displaying in your WordPress sitemap, or if you want only certain pages to display in your sidebar.
In this step-by-step tutorial you will learn how to locate post and page IDs in a WordPress site.
How To Locate WordPress Post And Page IDs: Step-By-Step Tutorial
To locate your page or post ID, log into your WP administration area and either go to the Pages area (if you want a particular page ID), or the Posts screen (for IDs of posts) …
Find the page or post that you would like to know the ID of and hover your mouse over its title …
The unique “page ID” value is displayed in the status bar of your browser window. In the example below, the post ID is 5575 …
Write down the ID of the post or page.
Page/Post IDs – Practical Uses
Here are some practical ways to use page and post IDs:
Exclude Posts Or Pages From Showing In A Site Map
Suppose we need to exclude a page whose ID is “26” from displaying to visitors on a site map.
Many site map plugins have fields that let you specify the IDs of items you want to exclude (e.g. categories, pages, etc.) …
Prevent Posts And Pages From Appearing In The Sidebar
Another practical use for page IDs is to prevent them from appearing in your sidebar.
To do this, simply enter all of the 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 Site’s Sitemap
You can also use post and page IDs to exclude pages or posts from your site’s XML sitemap …
If you want to know your page or post IDs “at-a-glance”, then here are a few FREE plugins that you may find useful:
This free WordPress plugin reveals the ids for pages, posts, links, categories, users, media, comments, link categories, custom taxonomies, custom post types and tags. It also adds a sortable column header to your Posts and Pages tables …
To access the plugin settings go to Settings > Reveal IDs …
Learn more about the plugin here: Reveal IDs
99 Robots Show IDs is another plugin that lets users view their pages, posts, media, links, categories, users and tags in the Posts and Pages admin tables. It’s also a very lightweight plugin that supports custom post types and taxonomies.
To download this plugin, go here: WP Plugin – 99 Robots Show IDs
Congratulations! Now you know how to easily locate the unique ID of any post or page in WordPress.