Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.