WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

How I could made a sql query who retrieve all the sticky post in a wordpress database? This is because we use a new app over the old wordpress website database, and I don't know where Wordpress "store" the sticky attribute.

Thanks in advance

share|improve this question
up vote 1 down vote accepted

It's not stored as attribute, but as list of all stickies. Snippet from core:

$sticky_posts = get_option('sticky_posts');

So look for the option and then use IDs to retrieve posts.

share|improve this answer
But inside the database is stored in some form, no? I can't use the php code, because I have only the database, so I only could use sql. – Nisanio Jun 28 '11 at 21:22
@Nisanio it's in option, so look in options table (wp_options or whatever your db has) – Rarst Jun 28 '11 at 21:27

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.