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


  • 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
Blog Rating
Notify of
Newest Most Voted
Inline Feedbacks
View all comments

global $post;

$page_id = $post->ID;


your code is for posts, not for pages


on wordpress, page = post


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


Thanks guys. Very useful stuff simple and effective.


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


Thank you, thank you, thank you!


YES! Finally! Thanks 🙂

Jacob S.

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

Simple and to the point. Thanks!


What? No one uses custom link structure?

Jasmine Andrews

Thanks! Just saved me from installing an unnecessary plugin.


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 . 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.


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.

Would love your thoughts, please comment.x