How to find the post_id of a post on a wordpress blog that uses pretty URLs?

The only trick here: It is not my blog, I know how to do it using php in my blog. I want to find the id of a post on another wordpress blog through the internet. Does this information ‘leak’ somewhere, is it possible to be found by a third party?

Related posts

Leave a Reply

2 comments

  1. Most themes that I’ve seen use the post ID as the ID of the wrapping div for a post on the home page, archives, single post, etc. For example:

    <div id="post-1920" class="post [...]">post content and meta</div>
    

    So you could parse that with a regex or using something like Simple HTML DOM.

    But again, this is theme-dependent. It may not work 100% of the time.

    Also, on the single post page, if there is a comment form, there should be a hidden input with the name “comment_post_ID” that contains the post ID.

  2. If you view the source of the page and view the classes in the body tag it will have a class like page-id-232 or postid-1000 where the number is the id you want.