Breakdance4fun Logo

How to use AI to help you create your own Custom Query

When the Query Builder is not sufficient, we can add our own code by using the Text or Array method. I see little reason to use the Text method, as it is better to focus on the Array method.

Query Array

However, it can be quite challenging to write a proper array, with all the options and conditions. A small mistake can render our query ineffective or prevent it from working as expected.

This is where the AI comes in.

Simply provide the instructions and add a specification like "show me in this format only: return ['post_type' => 'post']";

In most cases, this is sufficient for the AI to generate our query in the correct format. In my example, I used DeepSeek v3 because it is very good for code and relatively inexpensive, but it can work with most other LLMs.

Deepseek Wp Query

The custom query has been created, we can now copy and paste it directly into Breakdance to test it.

Query Array Ex