WP_Query & You

If you’re building WordPress themes or plugins, WP_Query is certainly something you’ve needed to use whether you realize it or not. In addition to providing a very clean and simple means for generating complex MySQL queries, WP_Query also does a number of different things behind the scenes that help us access our data effortlessly and efficiently. However, these same features that make WP_Query easy and powerful can also cause us much grief without us even realizing it.

Whether you’re just getting started with WordPress development or you’ve been writing queries pretty steadily for several years now, there’s bound to be a nugget (or several) of information in this presentation that will surprise and even help you.

What You’ll Learn

  • Common (mis)uses for WP_Query, get_posts(), and query_posts()
  • The many, many query parameters that are available to us
  • Some of the more advanced ways we can query based on date, meta, or taxonomy data
  • What actually happens each time WP_Query is called
  • An abbreviated look at the many steps WP takes in serving a given page request
  • The many ways a query can be modified and refined via several different hooks
  • Finally, we’ll discuss the risky pitfalls and practical performance wins WP_Query provides