A query is a request for specific data from your WordPress database — like “show me the five most recent posts in the Recipes category.” WordPress runs queries constantly, behind the scenes, to display your content.
The Main Query
Every page load starts with what’s called the “main query,” which determines what content should appear based on the URL being visited. Visiting a category archive triggers a different main query than visiting a single post.
Custom Queries
Beyond the main query, developers and plugins can run custom queries to pull specific content — like a “related posts” section, a list of popular articles, or a filtered product grid.
Where This Comes Up for Site Owners
You might encounter the term “query” indirectly through the Query Loop block in the block editor, which lets you display a customized list of posts — filtered by category, tag, or order — without writing any code yourself.