First look how complex is your preg replace. Usually, you may get into errors with that.
NODE EXPLANATION
--------------------------------------------------------------------------------
/ "https://wordpress.stackexchange.com/"
--------------------------------------------------------------------------------
\( '('
--------------------------------------------------------------------------------
\s* whitespace (\n, \r, \t, \f, and " ") (0 or
more times (matching the most amount
possible))
--------------------------------------------------------------------------------
post_title 'post_title'
--------------------------------------------------------------------------------
\s+ whitespace (\n, \r, \t, \f, and " ") (1 or
more times (matching the most amount
possible))
--------------------------------------------------------------------------------
LIKE 'LIKE'
--------------------------------------------------------------------------------
\s* whitespace (\n, \r, \t, \f, and " ") (0 or
more times (matching the most amount
possible))
--------------------------------------------------------------------------------
( group and capture to \1:
--------------------------------------------------------------------------------
\' '''
--------------------------------------------------------------------------------
[^\']+ any character except: '\'' (1 or more
times (matching the most amount
possible))
--------------------------------------------------------------------------------
\' '''
--------------------------------------------------------------------------------
) end of \1
--------------------------------------------------------------------------------
\s* whitespace (\n, \r, \t, \f, and " ") (0 or
more times (matching the most amount
possible))
--------------------------------------------------------------------------------
\) ')'
--------------------------------------------------------------------------------
/", " "https://wordpress.stackexchange.com/", "'
--------------------------------------------------------------------------------
( group and capture to \2:
--------------------------------------------------------------------------------
post_title LIKE 'post_title LIKE '
--------------------------------------------------------------------------------
$ before an optional \n, and the end of
the string
--------------------------------------------------------------------------------
1 '1'
--------------------------------------------------------------------------------
) end of \2
--------------------------------------------------------------------------------
OR ' OR '
--------------------------------------------------------------------------------
( group and capture to \3:
--------------------------------------------------------------------------------
geotag_city LIKE 'geotag_city LIKE '
--------------------------------------------------------------------------------
$ before an optional \n, and the end of
the string
--------------------------------------------------------------------------------
1 '1'
--------------------------------------------------------------------------------
) end of \3
--------------------------------------------------------------------------------
OR ' OR '
--------------------------------------------------------------------------------
( group and capture to \4:
--------------------------------------------------------------------------------
geotag_state LIKE 'geotag_state LIKE '
--------------------------------------------------------------------------------
$ before an optional \n, and the end of
the string
--------------------------------------------------------------------------------
1 '1'
--------------------------------------------------------------------------------
) end of \4
--------------------------------------------------------------------------------
OR ' OR '
--------------------------------------------------------------------------------
( group and capture to \5:
--------------------------------------------------------------------------------
geotag_country 'geotag_country LIKE '
LIKE
--------------------------------------------------------------------------------
$ before an optional \n, and the end of
the string
--------------------------------------------------------------------------------
1 '1'
--------------------------------------------------------------------------------
) end of \5
Next, you need to provide full SQL query example after preg_replace
.
If we can have the full SQL query, we may also understand the customization.
Looking at what you wrote we need to have the arguments you set for the WP_Query, to understand how you organized the query.
More, CONCAT
is not a smart thing in there, it forces MySQL to concatenate strings — a slow down factor.
Hope this may be helpful.