Finding the WordPress Page ID

In WordPress versions prior to 2.5 we could see the Page and post IDs in the WordPress admin panel. But from WordPress 2.5 and later, these are not displayed directly in your dashboard.

Here’s how you can find the IDs in WordPress 2.5 and later.

One Way

After you’ve logged into your WordPress dashboard, Go to Manage > Pages and from the list of Pages hover over the Page title you want to find the ID of. Every time you hover over, your browser’s status bar will show you a URL ending with a number like this.

http://www.xyz.com/wp-admin/page.php?action=edit&post=6

The number with which the URL ends is the Page ID (6 in this case).

Another

If you don’t see anything when you hover over, click on the Page link to open edit Page screen. Now, look in your browser’s address bar and you’ll find the URL ending with a number. and that is your Page ID.

finding the WordPress Page ID

Again, the number with which the URL ends is the Page ID (6 in this case).

80 Comments

  1. Scott Hone says:

    Awesome! Thanks.
    -Scott

  2. Christian_R says:

    Thanks!

  3. Marco says:

    Thanks!

    Weird that WP hides the pageID. It is of limited to no use for the average user, but when you get into custom php code it may be very useful.

  4. Anthony says:

    Unless Wordpress is set to rewrite the URL’s … ?

  5. base says:

    Anthony: In that case, you can use the first method. even with mod rewrite on, the administration panel will still show a pages ID.

  6. Mankosas says:

    Just found this post on Google and it helped, thanks.

  7. Rob Lewicki says:

    Great post! Thank you.

  8. Herb says:

    Thanks for helping me find the page id for my wordpress blog!

  9. sikis says:

    Thank you soo mach

  10. Nick says:

    Thanks. I already changed my slugs, and was having a hard time trying to find the page #s!

  11. Tacchi says:

    you made my day. thanks ;)

  12. mark says:

    how do you find the page id of the index blog?
    I’m using custom fields to use a dynamic banner for each page (using an if else statement). I use the page IDs for the pages to show a certain image.
    Funny how something like this I can’t solve after searching around for a bit.
    So in summary, I need the page id for home (and home, index, and 1 don’t seem to work). any ideas?

    thanks : )

    • David says:

      I need the page ID for the home page. Any ideas?

    • Just found this information at wordpress.org:

      In the theme’s header.php file, change the tag to this
      <body>

      On the homepage, your body tag will now say
      You can now override any existing styles for just that page.
      For example, in your present stylesheet, your sidebar is defined as
      #sidebar { width: 220px; }

      If you add this to the stylesheet:
      body#homepage #sidebar { width: 175px; }
      on the homepage only the sidebar will display as 175 pixels. On all other pages it continues displaying at 220 pixels.

      It works, I was able to set up a custom menu with this.

  13. Peter says:

    Is it possible to get the url (permlink) to a page if you have the page id?
    Thanks, Peter

  14. Trat map says:

    As mentioned by others, the second method only works if you don’t mess with the permalink settings (and you should – since a textual url is better SEO-wise).

    Anyway, thanks for primepress. Very comfortable to tweak.

  15. Paul says:

    Thank you for your generous help.
    Finding the the WordPress Page ID is such a silly little thing but was driving me around the bend trying to identify how to find it.

    Thanks for a great website and packing it full of practical information.

  16. bayrak says:

    thank you admin very very nice blogs :D

  17. bayrak says:

    Hey, nice post, really well written. You should post more about this. I’ll certainly be subscribing.

  18. Unless Wordpress is set to rewrite the URL’s … ?

  19. Nice, Thanks Ravi that is great. I cannot believe it is as simple as using Manage > Pages I wish I knew that before as it would have saved me hours of messing around!

  20. mark says:

    hey, great post…

    How would I find the page ID of the home page? The url info that appears for the home page does not have ID info, and I need the ID to modify a template (Atahualpa)

  21. Thanks!

    Isn’t it incredible how one can waste so much time over not knowing silly details like this one.

    Wonderful!

  22. Thanks Guys. Wonderful

  23. have been reading about this a lot recently – what a brilliant idea – saved me tons of wasted time.

  24. Fred says:

    Thanks so much for this! This is so incredibly odd! Yes, I did change the permalinks to suit me, and short of exploring the database, would never have found this. I’m off to glue my hair back in.

  25. oguzhan says:

    Wikipedia is great!

  26. oguzhad says:

    Thanks Guys yeah!!!

  27. Yes, i will use this and try. Hope it will work.

  28. Randall says:

    I’m using WordPress, a theme from iThemes and Ecto on my Mac OS 10.5

    I found the “hovering” tags, but they don’t include the page ID, just the page title. Any ideas why mine are gone and where else I could find them? I want to remove the About and Contacts pages from my pages sidebar widget, and I can’t without the proper ID.

    Thanks!

  29. the jodi says:

    You’re an angel. This was exactly what I needed. Thank you

  30. jcnjr says:

    thanks! this post was top search result for “how to find wordpress page id”.

  31. thanksssssss….. broooooo….
    Its very help me…..

  32. Walt Dowdy says:

    Thanks Ravi! Simple posts like this will live forever.

  33. Lei-Lei says:

    Thank you very much for this! Really helpful xD

  34. vusi says:

    thanks, why cant they just put it in the bloody admin panel somewhere!

  35. i looking this page id, thanks for the explaining.

    Great design.

  36. Thanks! it helped alot. I had modified my URL’s to a custom one and then didn’t think I still had page id’s. But this post helped.

  37. Tyler says:

    Thanks this was helpful

  38. nophindahoz says:

    great bro! it really helps when i’m customising my blog… thank u very much! regards from indonesia :D

  39. Harshida says:

    Hello,
    i have question that in my Wordpress with CMS site i have 6 page all, each page have page id

    for example ABOUT PAGE url is like
    http://localhost/wordpress/?page_id=178

    but what i want insted of page_id=178 i want
    http://localhost/wordpress/?ABOUT.
    Give me the solution for this.

    Thanks
    Harshida Parmar

  40. Thanks…. That was a complete pain in the ass to find…

  41. Nick Polino says:

    Straight and to the point, thank you very much.

  42. driver27 says:

    Up to 20 percent of the metals can be lost in a crusher. ,

  43. Another Thanks. This is one of these annoying little things that you find out how to do and then by the time you need to know again the next time you forget and have to find out all over again :( . But thanks to Google and sites like yours it’s easily solved :D

  44. masa subur says:

    I already fine my page id, thanks for article.

  45. Rose says:

    Thank i was wondering about that to find out my past posts. I am using Rosehost Web Hosting and its a very good host for wordpress sites. haven’t got any problems with them.

  46. good point.Thanks so much for sharing these useful informations.

  47. Sometimes wordpress can make you crazy. Thanks for making it simple ;-)

  48. Marcia says:

    Thanks! Had never needed to know the page id; then today, I was in a hurry to get a new template going – and Google found you,

  49. Hi Ravi,

    nice post. I use permalinks and I was searching for the page id… :)

    Thanks Again

    George

  50. Acai says:

    Great post! this will help me to customize my blog based on the page ID, a real beauty! Thank you for sharing ;)

  51. Blake says:

    This helps so much. I was just about to punch my computer in frustration.

  52. Cheers Ravi, clear and concise instructions. Many thanks.

  53. passang says:

    Thanks. Your post solved my problem.

  54. Alec Hanson says:

    Sooooooo Simple I had to kck myself for not thinking about it!

    Much appreciated.

  55. John Writer says:

    Been struggling with how to noindex a downloads page for some weight loss plr I was making – i needed the wordpress ID and couldn’t work it out. This really helped so thanks a lot!

    John

  56. CT says:

    I am looking to change my “blog” page in WordPress. One of my static page links in the navigation is off center. I want to get it looking better. HOW DO I MANIPULATE THE CODE TO DO THIS IN THE BLOG PAGE? http://wisdom360.cc/?page_id=2 WHERE IS THIS FILE FOR ME TO CHANGE? IS IT CSS? IS IT .PHP? I can see the source code, but can’t seem to find where to change it in my template appearences editor. Thanks!

  57. Tony Stark says:

    Just what I needed! Thanks, friend!

  58. Dave says:

    Ah man – this was driving me nuts!
    Thanks!

  59. Mahindra says:

    Thanks a lot, this was really helpful.

    Peace

  60. paul says:

    Saved me quite a bit of time. Thanks!

  61. Simon says:

    Thanks!

  62. moonpixel says:

    Thanks a lot mate, saved me some time…

  63. Jen says:

    Thank you! This was driving me crazy.

  64. NET-TEC says:

    Great. I dont know, why they removed the ID from the admin. It was surely a step back in userfriendlyness.

  65. Ray says:

    I needed to create a sitemap page for my WP blog ASAP and your post helped me do it very quickly. Thanks a million!

  66. Stephen says:

    IDs absolutely should be shown in admin just like in Joomla, etc. Incredible that you have to fiddle about to find such basic stuff.

  67. Saz says:

    Thank you!!

Trackbacks / Pingbacks

  1. [...] 418 is the pageID of the page you want to add comments to. See this post on how to obtain the pageID of a page in WordPress. To add multiple pages do [...]

  2. [...] the Page ID and the image file name according to your site. (parts marked in [...]

Leave a Comment

You can use these HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>