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

In one of my form input, the options are a list of posts. I can use the loop to get the posts, but, getting things from database table is faster, right? I see plugins sometimes use db directly, sometimes use loop. I'm confused.

share|improve this question
up vote 0 down vote accepted

In general I try to avoid custom SQL queries as much as i can and use the native WordPress functions but in some cases its much better/faster to use custom queries.

if the case is just get a list of posts the you can use the WP_Query or get_posts which will work almost as fast as a custom query (as long as you don't need some advan

share|improve this answer
I see, thanks! I hate the freedom :-)) – Jenny Feb 27 '12 at 11:51

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.