Query Builder

1 min read

Query Builder is a powerful feature in the Dynamic Engine plugin that lets you create reusable, dynamic queries for posts, terms, and users, complete with macros, live preview, and health checks.

Get Started #

  • Navigate to Query Builder from Dynamic Engine.
  • Click Add Query, or use the Create Query button if this is your first listing.
Image

Give your query a name, like “Agent Query.”

Image
  • Next, choose your Query Type. You can pull data from Posts, Terms, or Users
  • Then select the specific post type you want to query, such as Agent
Image
  • Status: Lets you choose which post statuses to include in the query, such as Published, Draft, Pending, Private, Scheduled, or Trash. Multiple statuses can be selected at once.
  • Sticky posts: You can uncheck the option to ignore sticky posts. When enabled, sticky posts follow normal date order instead of jumping to the top, recommended for latest or archive-style lists.
Image

The Filters tab lets you control:

  • Date Range: Set Posted After/Before to limit posts to a specific time window
  • Include/Exclude IDs: Enter comma-separated post IDs to keep or remove specific posts
  • Author Filter: Filter by a user ID (or {{current_user_id}} for “my posts”)
Move to the Filters tab to control status, author, dates, and included or excluded IDs.

In Tax and Meta, add taxonomy or meta query rules to narrow down results based on specific field values.

The Relations tab lets you filter posts, terms, or users based on their relationships, using macros like current post ID as an anchor so each item pulls its own related data.

Under Order and Paging, set how results are sorted and how many items appear per page.

The Macros tab gives you dynamic tokens like current post ID, current term ID, and current user ID, so your queries adapt automatically based on context. You’ll also find a URL Parameter Builder and Relation Macros for pulling related titles, permalinks, and meta fields.

Image

Once everything is set, go to Preview and click Run Preview to test your query live against real data before saving.

Finally, check the JSON tab for a read only view of your full query configuration, useful for debugging or reusing as a template.

Click Create Query to save, and your query is ready to use across listings, related content blocks, or shortcodes.

Finally, go back to the Query Builder list, where you can see all your saved queries.

Here you’ll find the query name, type, source, and status, along with quick actions to edit, duplicate, or delete any query.

You can toggle a query active or inactive anytime, or click the edit icon to open it in the Edit Query screen and fine tune the source, filters, ordering, and macros with real time preview.

And that’s it, your reusable query is saved and ready to power your listings, related content blocks, and shortcodes across the site.

Updated on August 30, 2026

What are your feelings

  • Happy
  • Normal
  • Sad
Table Of Contents