I have a arbitrary string and want to check if a post with that slug string exists in the site. I tried to find a way to list all slugs, but can't find such a thing. Thanks

link|improve this question

60% accept rate
feedback

1 Answer

Do you mean post slug? You can try to make use of wp_unique_post_slug() that WP uses to generate those. If I remember right if slug you are trying to use is not unique it will be returned with numerical index appended.

link|improve this answer
sorry to reply so late. Yes post slug is the slug I want. Unfortunately I don't have the post_id which is required to use wp_unique_post_slug() – lulalala Aug 22 '11 at 1:43
feedback

Your Answer

 
or
required, but never shown

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