BLACK FRIDAY SALE: Get 50% Off On Any UNLIMITED DOWNLOADS Plan! Use Code "blackfriday" At Checkout

DOWNLOAD ALL NOW!

Search for a plugin or theme

How to Get and Find WordPress Page and Post ID

You are currently viewing How to Get and Find WordPress Page and Post ID

In this article, we’ll teach you how to find WordPress page ID along with posts, media, categories, and tag IDs.

There are few ways on how to reveal those IDs, some ways are manually and other ways could be with a plugin. In this article, we will show you all the possible ways.

Why Use the Post or Page ID

The main reason for you to know and use the ID of a page or a post would be when using a custom function or creating a template.

Oftentimes, when building a page template or using a function, you’ll need to target a specific page of your WordPress website. Because every page or post has a unique ID number, that is the best way to target a page.

One of our previous posts showed you how to redirect an empty checkout page to a different page with a function. The function needed the page ID of the destination page for the redirect rule to work. That is a classic reason when to use a page or post IDs.

Custom function need a page ID

How to Find WordPress IDs With a Plugin

As you already know, there are WordPress plugins for everything, and many to display the ID of a page or a post. In fact, there are many plugins out there to do that but I would like to focus on one plugin.

This article will show you how to use the Catch IDs plugin to display the IDs of pages, posts, categories, tags, and media such as images and videos.

Navigate to Plugins -> Add New, search for Catch IDs, install and activate it.

Install the catch ID plugin

After activating the plugin, you’ll see a new ID column added to the left of the page or post name.

You can also see the column added in the media, categories, and tags pages.

New ID Column

If you don’t see the new ID column in your admin screen, navigate to the Catch IDs tab on the left, and make sure all the options are turned on and green.

Catch ID plugin settings

How to Find IDs Without a Plugin

As we mentioned above, there are many plugins out there that will help you with that. But the truth is that we can still find the ID of a page, post or etc without a plugin. The information is there, we need to know where to look.

There are many ways on how to discover the ID without a plugin and now I will show you the most common ones.

Using the View Page Source

This is one of my favorite ways to reveal the ID because you don’t have to be logged in to your WordPress website. When I’m working on custom functions on my local machine, it saves the extra time of logging in and navigate to the pages list.

To use the Page Source Code method, navigate to the desired ID of the page or item that you would like to find. Right-click anywhere on the page and click on View Page Source.

View Page Source Of a Page

Don’t get overwhelmed by the exposed page source code. It is a big one but we are only going to look for the ID number.

Use your keyword to search by clicking on CTRL + F (Windows) or COMMAND + F (Mac) and search for id-. The numbers to the right of the search result are the ID number.

View Page Source to find the ID

In the example above, the revealed post ID number is 105.

Find IDs From the Admin Screen

Another great way to expose any ID in WordPress is from within the list pages. Again, you can use it for posts, pages, categories, tabs, and media.

For example, if we would like to find an ID of a page, we will navigate Pages -> All Pages.

Navigate to all pages

All that has been left to do is to hover our mouse on the edit option of the desired page. By hovering on it, the edit link of that item exposed and we can find the ID in the link on the bottom left side of the screen.

Hover on edit to expose the ID

The nice thing about this method is that we don’t actually need to click on the Edit option. Hovering on it is enough and will do the trick.

By using this method, you can save a lot of time if you need to get the IDs of many items. You can go through many items without getting into the edit screen for each of them.

In the Edit Screen

If finding the ID using the method above didn’t work, you can still find the ID from inside the edit screen.

To do that, launch the edit screen of your desired item. Again, that will also work with categories, tags, and media.

Edit page to reveal ID

From inside the edit screen, look at the URL in your browser and look for post=. The number to the right is the ID of the page, post, or media.

Look for the ID in the edit page URL

In the example above, the page ID is 23.

If you are looking to find a category ID or tag ID look for category&tag_ID= and post_tag&tag_ID= respectively.

Find category ID in the edit page URL

In the example above, the revealed category ID is 4.

Conclusion

Finding the IDs is easy with or without using a plugin. If you need to find IDs often, using a plugin will definitely going to save you a lot of time. But if you only need to find an ID once in a while you can go ahead and use the manual ways I showed you above.

If you have any questions or comments, please let us know down below.

Also, make sure to subscribe to our YouTube channel and like our page on Facebook.

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on email

PluginsForWP

PluginsForWP is a website specializing in redistributing WordPress plugins and themes with a variety of knowledge about WordPress, internet marketing, and blogging.

Leave a Reply