WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.