Disclosure: ULTIDA's content is free & reader-supported. We may earn a commission if you click & buy through our links. Your support helps us create the best content & make a difference.

How To Find WordPress Post ID & Page ID (Easy!)

how to find wordpress post id page id

Are you wondering how to find WordPress post ID and page ID?

There are several cases where a WordPress plugin or theme will ask for your post or page ID.

ID number is used when a plugin has options only to make changes or add functionality to a certain post or page.

This post covers:

While, in general, the post ID is not hard to find, it’s still not as obvious as it should be.

Thus, many users scratch their heads (for quite a while) before they find it. I struggled when first started with WP, too, ended up searching for a tutorial.

But, all jokes aside, let’s see what a WordPress post ID is.

What Are WordPress Page & Post IDs?

Post and page IDs are UNIQUE identifiers in the form of numbers that point to a specific post or page.

That means that every piece of content on your website can be accessed via that number.

And that is also true for products, categories, tags, etc., not just posts and pages.

Even comments!

Yup, everything has a unique number. (Like we do.)

Why Do You Need Page, Category, Tag, Comment & User IDs?

The most common use is in WordPress plugins.

For example, you want to highlight specific posts in your website’s sidebar.

By default, there are WordPress widgets like Popular Posts or Recent posts, but they are dynamic and the posts in the widgets will change constantly.

And while these are great features, you sometimes only want to display a few specific featured posts.

It’s like you’d be pinning a specific post in your blog feed or even your Instagram profile.

And that’s when a post or page ID comes in handy.

You can use them to display ONLY the selected (highlighted) content.

Find Your WordPress Page ID & Post ID Without A Plugin

Let’s first look at how you can find post and page ID without using a WordPress plugin.

How to find the post ID

When you are adding or editing a post, the ID number will be visible in the URL of your browser.

Not the WordPress permalink below the title, but the actual URL of the post you are editing.

how to check post id number without a plugin

The highlighted number from the example above is the post’s ID number.

That was simple enough, right?

How to find the page ID

Like the example above, head to your pages and edit the page from which you want to extract the ID number.

how to check page id number without a plugin

As you can see, the ID number is again part of the URL.

Simply copy and paste it into the plugin that requires it.

Bonus: How to find category, tag & comment IDs

Finding ID numbers for categories, tags and comments works similarly.

Only the semantics are slightly different.

To find an ID for a certain category, head to Posts > Categories and edit that particular category.

how to check category id number without a plugin

In this case, the number is hidden in the tag_ID identifier.

Follow the same procedure to find the tag ID (head to Posts > Tags and edit that particular tag).

And finally, let’s extract the ID number of a specific comment.

Yes, even comments have unique identifiers, even if you have 1,000s of them.

Head straight to Comments > All Comments and edit that specific comment you are interested in.

how to find comment id number without a plugin

As you can see from the image above, the number is behind the letter C (as “comment”) this time.

So, the steps to find the unique ID of each piece of content are very similar in all examples.

Just don’t be misguided by different identifiers that are used. In the end, the ID is always a number.

Note: I don’t recommend using a plugin to identify ID numbers because it’s quick to find them manually.

But still:

Find Your WordPress Page ID & Post ID With A Plugin

If you prefer using a plugin to find your content’s ID, first install and activate a WordPress plugin.

I recommend using Reveal IDs WordPress plugin from the WP repository.

how to find id with reveal wordpress plugin

After the activation, head to posts (or pages, comments, categories, etc.).

You will notice an extra column at the end named ID that represents the ID number of that particular piece of content.

And there you go. It’s as simple as that.

You can now see the ID number of each post from the main posts or pages interface.

There is no need to edit each post individually to see it; that can save you a lot of time.

Find Your WordPress Page ID & Post ID With Custom Code

If you are tech-savvy and comfortable editing the functions.php file, you can also add some custom PHP code to display the ID numbers in the same manner as the Reveal IDs plugin.

Attention: I don’t advise dealing with the code if you don’t know exactly what you’re doing.

You must use an FTP client like Filezilla to modify the file.

Follow these steps to edit the functions.php file:

  1. Connect to your host through the FTP client. You need your FTP username and password for that. (Contact your hosting if you don’t have login credentials.)
  2. Navigate to the /wp-content/themes/ folder once connected.
  3. Find your theme’s folder (make sure you are using a WP child theme because it allows you to update WordPress theme without losing previous customizations).
  4. Locate and download the functions.php file within your theme’s folder.
  5. Edit the file with a text editor (I recommend Notepad++).

Here’s the code you need to add to this file:

function add_column( $columns ){
	$columns['post_id_clmn'] = 'ID'; // $columns['Column ID'] = 'Column Title';
	return $columns;
add_filter('manage_posts_columns', 'add_column', 5);

function column_content( $column, $id ){
	if( $column === 'post_id_clmn')
		echo $id;
add_action('manage_posts_custom_column', 'column_content', 5, 2);

This code snippet will add an extra column at the end that displays the ID number of the post.

Without a plugin like in the above case.

Conclusion On How To Find Page & Post IDs

New users can be confused with the term post/page ID as it’s not very obvious what it represents in WordPress.

And when they install a plugin that requires the ID number to work properly, some admins cannot locate it.

And that’s where my tutorial comes in handy.

Remember, you will find that necessary ID number in no time. You just need to look in the right place.

FAQs About Finding WordPress Post & Page ID

What is a WordPress post or page ID?

The post or page ID is a unique numerical identifier WordPress assigns to every content you create. This includes posts, pages, and custom post types. It’s used internally by WordPress to manage and reference your content.

How can I find the post or page ID in the WordPress admin dashboard?

To find a post or page ID in the WordPress admin dashboard, navigate to the “Posts” or “Pages” section, then hover over the title of the post or page in question. Look at the URL displayed at the bottom of your browser or click to edit the post/page and observe the URL in your browser’s address bar. The post or page ID can be found in the URL, typically following “post=” or “post=,” and before the “&” symbol if present.

Is there a way to display post and page IDs directly in the WordPress admin columns?

WordPress does not display post and page IDs by default in the admin columns. However, you can use a plugin like “Reveal IDs” or add custom code to your theme’s “functions.php” file to add a column that displays these IDs.

Can I find a post or page ID without accessing the WordPress admin?

Yes, if you have access to the website’s source code or can view the source HTML of a page, you can sometimes find the post or page ID in the body class attribute, which WordPress often includes for posts and pages. Look for a class in the format of “postid-{number}” within the body tag’s class attribute.

Why should I know the post or page ID in WordPress?

You need to know the post or page ID for customizing or targeting specific content with CSS or JavaScript, configuring certain plugins or widgets, setting up conditional logic in themes or plugins, or excluding/including specific posts or pages in queries.

About Author

Ales has been in love with computers ever since he got Amiga 500 almost 30 years ago. He earned his bachelor’s degree in Computer science from Ljubljana University, Slovenia. In 2010 he co-founded PremiumCoding, a website that makes awesome WordPress themes that are also for sale on ThemeForest. In the past few years, he focused mainly on combining web design, code and photography into a seamless experience.