1. Meta Query Fields Explanation
Field key/name – Enter the meta field name attached to your chosen Post Type. You can also use Dynamic Tags to customize the value with Context and Fallback settings if needed.
Value – The target value to compare against the meta field’s value.
Compare – Select how the values will be compared:
Equal – Displays posts with an equal value.
Not Equal – Shows posts with a different value.
Greater than / Greater or equal – Works with numeric values only.
Less than / Less or equal – For numeric values only.
Like – Finds partial matches.
In the list / Not in the list – Filters based on multiple values.
Between / Not between – Filters within or outside a range of values.
Exist / Not exist – Checks if the meta key exists.
Regexp / Not regexp – Used for Checkbox or Radio meta field values.
Type – Specify the data type of the meta field:
Char
– Alphabetic data (case-insensitive).Numeric
– Whole numbers.Date
/Datetime
– Date or time values.Decimal
– Fractional numbers.Time
– Time values.Signed
/Unsigned
– Whole numbers (positive or both positive and negative).
Clause name – Assign a unique name to the clause if you want to sort posts using it.
2. Use Cases and Examples
2.1 Query by Checkbox/Select/Radio Meta Field
Ensure “Save as array” is enabled if it's Checkbox meta field. (If not - enable it first and then resave posts with new values)
In Field key/name, select your metafield with macros “JetEngine meta field” and return the Field name/key/ID.
Set the Compare operator:
Like for Checkbox or multiple Select fields.
Equal for non-multiple Select or Radio fields.
Enter the desired value in the Value field.
2.2 Query by Media Meta Field
To check if a post has a file attached in the meta field:
Use “JetEngine meta field” and return the Field name/key/ID.
Set Compare to “Greater than” and the Value to 0.
2.3 Query by Date Meta Field
Example: Display posts starting after specific static date.
Note: Works only if your date meta field is saved as a Timestamp.
Add this code to your child theme’s
functions.php
or use the Code Snippets plugin: Code LinkConfigure Meta Query:
2.4 Query by Text Meta Field
Example: In a text meta field, you can add a date in the d.m. format (e.g., 01.12) to display posts annually on the same day and month specified in the meta field.
In Field key/name, use “JetEngine meta field”.
Set Compare to Equal.
Use “Current Date” macro with format
d.m.
for the Value field.
3. Advanced Query Example – Compare Meta Field with Current User Email
To filter posts where the current user’s email matches a text meta field: