You could try the REGEXP version:
'meta_query' => array(
array(
'key' => 'email_address',
'value' => '^hello@',
'compare' => 'REGEXP',
)
)
where ^ matches the beginning of a string.
You can check the MYSQL reference on REGEXP here for more info.
Notice that these are the possible values of the meta compare parameter:
'=', '!=', '>', '>=', '<', '<=',
'LIKE', 'NOT LIKE','IN', 'NOT IN',
'BETWEEN', 'NOT BETWEEN', 'NOT EXISTS',
'REGEXP', 'NOT REGEXP', 'RLIKE'
according to the WordPress 3.9.2 source.
From the MYSQL ref:
Name Description
------------------------------------------------------
NOT REGEXP Negation of REGEXP
REGEXP Pattern matching using regular expressions
RLIKE Synonym for REGEXP
Related Posts:
- compare meta_query in get_posts arguments
- Getting attachments by meta value
- querying with custom meta field with meta_query
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- WordPress altering my custom query, How to fix it?
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- Order by meta_key in custom post type doesn’t affect the query
- meta_key and meta_value not working together
- Order Posts by meta value AND published date
- How to make Meta Query case sensitive?
- Fetch Record based on meta key dates
- Meta_query with multiple keys and multiple values
- meta_query BETWEEN, but the range is stored in the custom field
- Extend product search with meta in WooCommerce
- how to make members list directory through wordpress post custom meta key.
- Large AND OR query timing out
- meta_value_num not ordering all items
- meta_compare not comparing whole integer
- Display posts with specific value first in query
- Get every post with value in meta key
- add_query_arg to compare and display events from a certain date
- Comparing 2 Decimal Numbers from custom fields and displaying posts
- meta_query weird behaviour, static int will work, but not user data
- Query multiple post types, but different order for each
- Order by the first array within a meta_query
- Query ACF relationship field – Comparator IN – Value array
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- How do i create a custom post query when the meta value is an array?
- WP Query – grouping posts by same meta key, adding together values from another key
- meta_query is overriding default search
- Trouble with serialized metadata
- Comparing Meta Field date in WPQuery using Meta_Query?
- Getting posts by custom field value
- Query against multiple locations within single custom post type post
- WP_Query, ACF field and array
- Order by Date Custom Field
- Query by meta value (add a dropdown of all values)
- Order Posts By Custom Field That is an array of objects
- Custom WP_query and integrating into theme file
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Compare meta key separation
- query post based on comparison
- Get posts by meta value except one post [closed]
- How to get products with the same custom attribute like ean code
- Can wp_query return posts meta in a single request?
- Function in array as arguments for WP_Query
- How to Compare Two Meta Fields
- WP_Query not working as expected for attachments and custom meta_query
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- Compare meta_query decimals not working right
- Display two post types ordered by two custom fields
- How to query ‘posts_per_page’ to display a different blog posts index template?
- Order By Multiple Meta Fields
- Advanced WP Query hogs the SQL server
- How to get user_id from wordpress database inside ajax function?
- getting posts and number by specific meta value in multiple meta
- WP_Query with multiple meta fields filter?
- How to combine meta_query and post__in in WP_Query
- How to orderby meta_value_num with dollar ($) sign
- Get posts for which a custom field is not present, with get_posts
- Output an array of terms for a ‘tax_query’ => array()
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- How to Filter Posts by Custom Fields?
- meta_query not working as expected
- Meta Query And/Or
- WP Group posts by year(desc) > month(desc) > date(asc)
- Query with meta_query and tax_query together not working properly
- Array as ‘key’ in WP_Query
- Is it possible to query a custom field where the value is between two fields?
- Filter posts by comparing custom meta value against postdate
- Searching for meta_key returns 0 posts
- WP_Query Meta_key is text value and need to sort as numeric not working
- filter wp_query result with custom field values
- meta_query fails to compare on values containing apostrophes
- Check if searched number is within the post meta value
- WP_Query not returning correct result with meta_query parameter
- Custom Meta Query doesn’t work the same on two site
- Retrieve all custom field values of a specific custom field metakey as an array, inside WP_Query
- How to do WP_User_Query for Nested Array value Inside Nested Array field
- Query for current post
- Custom query to retrieve oldest post and retrieve others with date interval
- Very slow query generated getting meta data from posts
- Order 2 meta_queries differently in WP_Query?
- How to filter on placeholder image
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- Meta_Query refuses to return results
- List users by Year of Birth using a foreach loop to dynamically populate years and data
- What is the best way to reset a search on a meta_key / meta_value?
- Slow query when selecting with large meta query or post__in
- WP Meta Query at depth 2
- Query events post type after current date and timezone
- Sorting posts by meta values: 2 different orders
- Is there any difference between below WP_Query code snippets?
- Order by three custom fields (Y-m-d), then separate into yearly sections
- Sorting: custom query with orderby meta_value_num THEN by title
- meta_query compare not doing what I want it to do
- WordPress Meta Query: Relation is not working correctly
- Can’t figure out query logic
- WP_Query orderby not working on custom post_type