Bird
0
0

Consider this query:

medium📝 Predict Output Q5 of 15
Wordpress - WordPress Query and Database
Consider this query:
$query = new WP_Query(['category_name' => 'news', 'posts_per_page' => 10]);

What is the effect of adding 'no_found_rows' => true to this query?
AIt caches the query results permanently
BIt sorts posts randomly
CIt forces the query to return all posts ignoring limit
DIt disables pagination count to speed up the query
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'no_found_rows' parameter

    Setting 'no_found_rows' to true skips counting total rows for pagination.
  2. Step 2: Effect on query performance

    Skipping count reduces database load and speeds up query when pagination is not needed.
  3. Final Answer:

    It disables pagination count to speed up the query -> Option D
  4. Quick Check:

    'no_found_rows' true = faster query without pagination count [OK]
Quick Trick: Use 'no_found_rows' => true to speed queries without pagination [OK]
Common Mistakes:
  • Thinking it caches results
  • Assuming it returns all posts
  • Believing it randomizes order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes