Mariolex,
Have you tried using meta_query? I wrote something quick and untested but it may do the trick:
$args = array(
'post_type' => 'posts',
'showposts' => '-1',
'meta_query' => array(
array(
'key' => 'pickup_address', //meta_key
'value' => '43 Longview Drive, Papamoa', //meta_value
'compare' => 'LIKE', //compare
),
),
);
$query = new WP_Query( $args );
print_r($query);
If that isn’t working, you may be able to recreate a similar query to yours by breaking each part of the phrase into individual arrays of the meta_query options. I don’t think you’ll need to since the LIKE comparison should find what you are looking for.
Be sure to check out the Meta Query documentation on WordPress.org – it’s a powerful tool that I use all the time for situations like this.
Sources:
- https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
- https://codex.wordpress.org/Class_Reference/WP_Meta_Query
EDIT
I misunderstood your query when I first read it. You can try this to see if you get a match for the value “43 Longview Drive, Papamoa”.
$args = array(
'post_type' => 'posts',
'showposts' => '-1',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'pickup_address', //meta_key
'value' => 'Papamoa', //meta_value
'compare' => 'LIKE', //compare
),
array(
'key' => 'pickup_address', //meta_key
'value' => 'Bah�a', //meta_value
'compare' => 'LIKE', //compare
),
array(
'key' => 'pickup_address', //meta_key
'value' => 'de', //meta_value
'compare' => 'LIKE', //compare
),
array(
'key' => 'pickup_address', //meta_key
'value' => 'Plenty', //meta_value
'compare' => 'LIKE', //compare
),
),
);
$query = new WP_Query( $args );
You may need to switch RELATION to “or” if you’re looking for both.