How to Find WordPress Page ID and Post ID?

How to Find WordPress Page ID and Post ID?

Are you looking for ways to find WordPress page ID and Post ID?

If you are using WordPress for quite a long time then you might come across a scenario where you need to find a page or post IDs. This can happen when you’re configuring a plugin or working with shortcodes.

In this article, we’ll discuss how to find WordPress page ID and Post ID.

What is Page ID and Post ID?

WordPress assigns a custom ID number to each and every content present in your site. Every page, posts, category, tag and even comments has its own ID number. 

WordPress Page ID and Post ID is basically a unique identification number assigned to every page and posts. WordPress uses it to keep track of pages, posts and other content present in your site.    

You might need a Post ID when you need to add widgets in specific posts. It also comes handy when you want to exclude or include specific posts and pages while working on a theme or plugins. Besides, you might need it to target specific posts while using a shortcode or code snippets 

Let’s get started:

How to Find WordPress page ID and Post ID

Finding WordPress page ID and post is very simple and it only takes a few seconds. However, it is quite indirect and hidden. 

To begin, login to WordPress dashboard with the login credential. Then navigate to Posts > All posts. Next, hover over the targeted post and click on the edit option.

edit post

Now, simply look at the URL in your web browser. You’ll see something like a post=NUMBER. This number you’ll see is the ID number.

post ID

Similarly, to find the WordPress page ID, go to Pages>> All pages. Then click on the edit page that you want to find page ID.

edit page

Now, all you need to do is look at the URL in your web browser. You’ll get the page ID number in WordPress.

page ID

How to Find a WordPress Category ID and Tag ID? 

The process is again simple and same when looking for categories or tags ID.

Go to Posts > Categories for category ID and Posts > Tags for tag ID. Then select the targeted categories or tags and click on the edit option. Now, check URL on the web browser and you’ll find the ID there as shown in figure below.

category ID

How to Find a WordPress Media ID?

The process of finding WordPress media ID is exactly similar to finding page ID.

 Click on Media > Library in your WordPress admin dashboard. Again, click on the media file that you want the media ID and an “Attachment Details” screen will pop up. Check the URL of th media file and you’ll get the ID. In this case, the ID appears as item=NUMBER.

Using PHP to find Post ID

This is an advanced method and requires a basic PHP coding skill. So, if you’re a beginner then it’s best for you to ignore it.

WordPress has a PHP function called  the_ID() function. It simply retrieves the Post ID and puts it on display.

All you are required to do is copy-paste the following code in your PHP front end, and the ID will be displayed.

<p>Post Number: <?php the_ID(); ?></p>

Alternatively, you can use the Reveal IDs plugin to find IDs of posts or pages. WordPress directory also has other post ID finder plugins that you could download. This method is best to quicken the process of finding the content IDs as it displays the IDs of all admin pages.

So, that’s all! You have successfully find WordPress page IDs.

Final Thoughts

Thus this is how you can find WordPress page ID and Post ID. I hope you find this article helpful to get page ID,  post ID or any other content ID in WordPress. You can also follow us on Facebook and Twitter. 

You might also like other similar articles:

One thought on “How to Find WordPress Page ID and Post ID?

Leave a Reply

Your email address will not be published. Required fields are marked *