Find the Page ID or Post ID in WordPress

Find the Page ID or Post ID in WordPress

Although WordPress is quite intuitive in most cases, there are some things that are not as obvious, such as:

“Where do you find the the page ID in WordPress?”

This is especially useful if you’re trying to exclude by Page ID certain pages that appear in the Pages Widget.

This tutorial will show you how to quickly find the hidden Page ID or Post ID in WordPress.

  • Log in to your WordPress site.
  • In the left menu click on Pages, then the title of the Page. In the image below, the title is “About Steve”.

Clicking to find the page id

  • The Page ID is hidden in the URL. Look for post= and the number to the right of it is your Page ID. In the image below, the ID is 6.

finding the wordpress page id

This technique also works for the Post ID of your pages.
  • Click “Posts” in the admin menu.
  • Click a Post title.
  • The Post ID will be visible in the URL bar. In this case, the Post ID is 1702.

finding the wordpress post id

Author

  • Nick Savov

    Nick is the Director of Support at OSTraining and you can find him in almost every area of the site, from answering support requests and account questions to creating tutorials and software.

0 0 votes
Article Rating
Subscribe
Notify of
guest

15 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
tokas
tokas
12 years ago

global $post;

$page_id = $post->ID;

Eawedat
Eawedat
7 years ago
Reply to  tokas

your code is for posts, not for pages

mal
mal
6 years ago
Reply to  Eawedat

on wordpress, page = post

Richard
Richard
3 years ago
Reply to  mal

Really post=page, have you ever worked with wordpress?

Brett
Brett
11 years ago

Thanks guys. Very useful stuff simple and effective.

johngreg
johngreg
11 years ago

brilliant post, I was wondering how to do this – so simple! thankyou!

Diane
Diane
10 years ago

Thank you, thank you, thank you!

A
A
9 years ago

YES! Finally! Thanks 🙂

Jacob S.
Jacob S.
8 years ago

I have been looking everywhere to find this. Such a simple solution! Thank you very much for sharing this!
Also, you can find the ID by just placing your mouse over the name of the page in your page list. It will appear in the bottom left corner of your browser.

Rolling Spoke
Rolling Spoke
8 years ago

Simple and to the point. Thanks!

SLembas
SLembas
8 years ago

What? No one uses custom link structure?

Jasmine Andrews
Jasmine Andrews
6 years ago

Thanks! Just saved me from installing an unnecessary plugin.

Viswanathan
Viswanathan
5 years ago

Hi can someone please help. I want to embed a page’s (and not post) content in my home age by using the shortcode of that page. 

The url of the page while editing is https://mysite.com/wp-admin/post.php?post=929&action=edit . Is there a way i can do this without bloating with plugins? I tried using short code [page id = “929”] and [post id = “929”] but didn’t work.

David
David
4 years ago

Thanks for your very helpful pages. Worked great on the widget for Pages. Forgot where the ID was at. Can now show my client what it will look like before it goes live in the Pages menu for the widget. Thank you very much for these pages.

15
0
Would love your thoughts, please comment.x
()
x