WP Web Workshop

WordPress Code Page ID Header

WordPress: How to Find Page ID & Post ID

Here are some methods you can use to find out the Page ID or Post ID for a WordPress Page or Post.

Look at the Page Source

While viewing the page as a user would, have a look at the page source code. You can view the source code by CTRL+U (Windows or Linux) or Option+Command+U (Mac) in most browsers.

Search for the following in the code if looking for a post ID:

postid-

Search for the following in the code if looking for a page ID:

page-id

This should display an area of the code in the body class that will show you the post id or the page ID. The number after the dash

Wordpress post ID displayed in page source code

Mouse-Over Edit Link

You’ll need to login to the WordPress Dashboard. Once logged in, go to Posts or Pages as desired, then mouse-over the “Edit” link under the post or page.

The link will appear at the bottom of the browser window. Posts and pages will say “post=” then display the post id or page ID.

Note: Even though pages say “post”, the number next to it is still the page ID.

WordPress Post ID shows upon Edit link mouseover

You can also simply just click the Edit button for the page or post and view the post or page ID in the address bar.

Wordpress post ID displayed in address bar

Use a Plugin

If you need the post or page ID displayed in a convenient place or view multiple post or page ID information at a time, the best option is to use a plugin.

There are many plugins to choose from to accomplish this. I recommend the simple and appropriately named Show Pages IDs plugin. This plugin will add a column in the dashboard for ID.

WordPress showing id next to pages using the Show Pages IDs Plugin

Updated

Comments

Leave a Reply

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