Skip to main content
Documentation/Dynamic Data/Loops/Queries/Text Query
Dynamic Data

Text Query

The Text query type takes query arguments as a single line of text, in the same form
the WordPress REST API uses. It's the quickest way to go beyond what the visual query
builder offers without writing PHP.

Setting a text query

  1. Select the loop element and open its Content tab.
  2. Set the query type to Text.
  3. Type the arguments into the field.
A loop element's query type set to Text, with arguments typed into the field

Start with the post type, then add each further argument after an ampersand:

post_type=product&per_page=6&orderby=title

Any argument the WordPress REST API recognises works here. The full list is in the
WordPress REST API documentation.

When to use it

A text query suits the cases the visual query builder
doesn't cover but that don't need real logic — ordering on something it doesn't offer,
or targeting a custom post type with a couple of extra arguments. When the query needs
conditions, variables or a function call, use an array query
instead.