Title: Plugin interfers with other WP_query()
Last modified: October 20, 2020

---

# Plugin interfers with other WP_query()

 *  [aolbrechts](https://wordpress.org/support/users/aolbrechts/)
 * (@aolbrechts)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/plugin-interfers-with-other-wp_query/)
 * Hello hello,
 * I’ve been asked to work on an existing WordPress installation where the Event
   Organiser plugin is installed (and working).
 * I realized that it interferes somehow with other WP_query() that are used somewhere
   else on the web site. And more specifically when I use tax_query
 * If the plugin is disabled, the query works. If I re-activate the plugin, it stops
   working. If I check the dump of the SQL query, I see it add some criteria which
   aren’t supposed to be there, and so I get no results where I should have some.
 * Here is a query for example, where no event info is related:
 *     ```
       $group_arg = array(
       	'posts_per_page' => 8,
       	'post_type' => 'church_group',
       	'post_status' => 'publish',
       	'tax_query' => array(
       		array (
       			'taxonomy' => 'domain_name',
       			'field' => 'slug',
       			'terms' => 'liege',
       		)
       	),
       );
   
       $group = null;
       $group = new WP_Query($group_arg);
       ```
   
 * The SQL dump is:
    `"SELECT SQL_CALC_FOUND_ROWS wp_5_posts.ID FROM wp_5_posts 
   LEFT JOIN wp_5_term_relationships ON (wp_5_posts.ID = wp_5_term_relationships.
   object_id) WHERE 1=1 AND ( wp_5_term_relationships.term_taxonomy_id IN (869) )
   AND wp_5_posts.post_type = 'church_group' AND ((wp_5_posts.post_status = 'publish'))
   AND wp_5_eo_events.StartDate >= '2020-10-20' GROUP BY wp_5_posts.ID ORDER BY 
   wp_5_eo_events.StartDate ASC, wp_5_eo_events.StartTime ASC LIMIT 0, 8"`
 * As you can see here, this whole part shouldn’t be in the query as I never asked
   for it: `AND wp_5_eo_events.StartDate >= '2020-10-20' GROUP BY wp_5_posts.ID 
   ORDER BY wp_5_eo_events.StartDate ASC, wp_5_eo_events.StartTime ASC`
 * Not very sure how to fix this, so any idea would be helpful, thanks!
    -  This topic was modified 5 years, 6 months ago by [aolbrechts](https://wordpress.org/support/users/aolbrechts/).

The topic ‘Plugin interfers with other WP_query()’ is closed to new replies.

 * ![](https://ps.w.org/event-organiser/assets/icon-256x256.png?rev=978123)
 * [Event Organiser](https://wordpress.org/plugins/event-organiser/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/event-organiser/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/event-organiser/)
 * [Active Topics](https://wordpress.org/support/plugin/event-organiser/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/event-organiser/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/event-organiser/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [aolbrechts](https://wordpress.org/support/users/aolbrechts/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/plugin-interfers-with-other-wp_query/)
 * Status: not resolved