Looper Query String crashing site

@kory
This string in seems to be crashing my site:
post_type=listing&post_status=publish&posts_per_page=50&orderby=date&order=DESC&meta_query%5Brelation%5D=OR&meta_query%5B0%5D%5Brelation%5D=AND&meta_query%5B0%5D%5B0%5D%5Bkey%5D=ffd_parcel_number&meta_query%5B0%5D%5B0%5D%5Bvalue%5D=&meta_query%5B0%5D%5B0%5D%5Bcompare%5D=NOT+LIKE&meta_query%5B0%5D%5B1%5D%5Bkey%5D=ffd_parcel_number&meta_query%5B0%5D%5B1%5D%5Bvalue%5D={{dc:post:meta key=“parcel_number”}}&meta_query%5B0%5D%5B1%5D%5Bcompare%5D=LIKE&meta_query%5B1%5D%5Brelation%5D=AND&meta_query%5B1%5D%5B0%5D%5Bkey%5D=ffd_subdivision&meta_query%5B1%5D%5B0%5D%5Bvalue%5D={{dc:post:meta key=“subdivision”}}&meta_query%5B1%5D%5B0%5D%5Bcompare%5D=LIKE&meta_query%5B1%5D%5B1%5D%5Bkey%5D=ffd_subdivision&meta_query%5B1%5D%5B1%5D%5Bvalue%5D=&meta_query%5B1%5D%5B1%5D%5Bcompare%5D=NOT+LIKE

Here is how I’m generating it:
$query = array(
‘post_type’ => ‘listing’,
‘post_status’ => ‘publish’,
‘posts_per_page’ => ‘50’,
‘orderby’ => ‘date’,
‘order’ => ‘DESC’,
‘meta_query’ => array(
‘relation’ => ‘OR’,
array(
‘relation’ => ‘AND’,
array(
‘key’ => ‘ffd_parcel_number’,
‘value’ => ‘’,
‘compare’ => ‘NOT LIKE‘,
),
array(
‘key’ => ‘ffd_parcel_number’,
‘value’ => ‘ENTER HERE’, (in Pro I add {{dc:post:meta key=“ffd_parcel_number”}} here)
‘compare’ => ‘LIKE’,
),
),
array(
‘relation’ => ‘AND’,
array(
‘key’ => ‘ffd_subdivision’,
‘value’ => ‘ENTER HERE’, (in Pro I add {{dc:post:meta key=“subdivision”}} here)
‘compare’ => ‘LIKE’,
),
array(
‘key’ => ‘ffd_subdivision’,
‘value’ => ‘’,
‘compare’ => ‘NOT LIKE‘,
),
),
),
);

Do you see anything wrong here that would be causing the site to crash? Seems like it’s overloading the server somehow.

Hello @marketfresh,

Thanks for writing to us.

I would suggest you deactivate all the 3rd party plugin and deactivate the child theme and activate the parent theme then check it again. I would suggest you, please troubleshoot a few common issues with our troubleshooting guide.

If none of those work, It would be best if you could copying your live website to your staging area. and send your details in a secure note so that we can investigate your setting without breaking your live site. Please provide the following details

  • WordPress Login URL
  • Admin level username and password
  • FTP Details

You can find the Secure Note button at the bottom of your posts

Thanks

The string I created is causing the site to crash because of too many queries to the database. I was wondering if you could detect any problems with the query and suggest a better way to do it so it doesn’t overload the db.

Hello @marketfresh,

It is not possible to debug the query since we can not create the same scenario at our end at the same time the query code is missing to code format.

I would suggest you please have a look at this thread where @kory has described the hook in the looper.


Hope it helps
Thanks

I did ready @kory’s posts and that’s how I learned about Query Strings and how to build them. Apparently the query string I created is bad or creating an infinite loop some how. I was hoping @kory or someone else in support who knows about query strings can evaluate what I wrote and find any obvious problems with it and explain how to do it correctly.

Thanks.

Hi @marketfresh,

Glad that you are able to find the way to write the Query String, please let us know if you have any further issues with this.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.