There are many situations where you may need to know the ID of a particular page or post in WordPress. A plugin might need it, for example, to exclude this page from a function. Or, if you are a developer, you may need to request this ID. Page and Publication IDs are how WordPress identifies all of the content on your website. Traditionally, platforms don’t publicly display this information, but it’s easy to find once you know where to look. Actually, there are many ways to get an ID for WordPress posts.
Need to find your WordPress Page ID or Post ID but don’t know where to look? Then you should keep reading. In this tutorial, we’ll look at quick and easy ways to display pages and post IDs on your WordPress dashboard. For each strategy, we have outlined clear and implementable steps to make it easier for you to find your WordPress Page and Publish ID.
What is a WordPress Page and Post ID?
Every piece of content on your WordPress site has an individual identification number. This includes pages and publications, as well as media files, comments, categories, tags, users, and more. This ID number helps organize the content in your site’s database and allows you to find, request, and target specific content.
Your WordPress Page or Post ID can be useful when coding your website or working with certain themes, widgets, or plugins. You may want to include or exclude certain pages or posts from the plugin’s functionality, which can be done using the page or post ID. Or you may want to show certain widgets on some pages but not on others. You can easily fulfill this requirement with an ID number. By being able to find and use Page and Publish IDs, you have more control over your WordPress website and can customize it exactly to your specifications.
Why is it useful to know how to identify post and page IDs in WordPress?
Internally, WordPress recognizes certain pages and posts based on their ID number. This information is sometimes needed when using a plugin that asks which posts you want to include or exclude from effect. In some cases, a WordPress Publish ID is also required to generate a custom shortcode. If you use a shortcode that requires the publication to be specified, you will be prompted for the publication ID as part of the parameter.
Another, more complex example comes when you add custom code to your website but only want to target specific pages. In this scenario, you can tell WordPress that if a post or page matches the id you provided, then the code you want to run.
How to find page ID in WordPress
There are many ways to find it. We’re going to look at two different and very easy ways:
Find your WordPress Page ID and Non-Plugin Post ID
Finding your WordPress Page ID or Post ID is a very fast process. To find the page ID, go to your WordPress dashboard and click Pages > All Pages. Then select the page for which you want to find the ID. Once the page is open, you need to see the URL in the address bar of your web browser. To find out the WordPress Post ID, do the same. Log in to your WordPress dashboard, then select Publications > All Posts. Click on the specific post for which you need an ID. Once you’re in the post editor, look at the post URL in your web browser’s address bar to find the ID.
Check the source code
The first method works but may take longer than we’d like to generate. It uses your browser’s built-in functionality and requires very little comfort with the code. First, right-click anywhere on the page for which you want to find the Post ID. The dialog box may differ depending on your browser, but Chrome users should select “Show Page Source”. This will display the HTML that your site will use to display the content. Scroll down until you find the body tag. From there, browse through the CSS classes until you find the one that references the publish ID.
Use the free Reveal IDs plugin
Using a WordPress plugin to find content IDs on your website can be a useful option if you want your Page or post IDs to appear together in your admin menu. This saves time and effort turning the editor on and off, as required with the first method discussed. Reveal IDs is a popular free WordPress plugin that is easy to install and works right away. Downloaded by over 70,000 people, Reveal ID displays all post and page IDs, as well as tags, categories, comments, users, and other types of content IDs in your WordPress content menu.
So let’s find out how to use it.
Step 1: Install Reveal ID
To install Reveal IDs, go to your WordPress dashboard and select Plugins > Add New. Then enter Reveal IDs into the search tool. Once the plugin is removed, click Install Now > Activate. Reveal IDs will now be installed on your WordPress site.
Step 2: view your Page and Post ID
Once installed, Reveal ID requires no configuration and you can find Page and Publication IDs available for review.
To view your page identifier, click Pages > All Pages in the WordPress menu. Here you can immediately see that an additional ID column has been added to your side menu showing IDs for each of your pages. To see the post ID, click Publications > All Posts. You will then find the post ID displayed in your post menu. Tag and Category IDs, as well as other types of Content IDs, can be displayed in the same way through their own menus.
Hide ID column
You may not need an ID column for all content types. If you want to hide the ID column for a specific menu, go to the menu page and simply click Options on the screen at the top of the page. Here we remove the ID column from the Publications menu: Then uncheck the ID checkbox and apply the changes.