The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End wordpress tax_query issue

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #189402

    Hello everyone,

    I have a wordpress website that until now has had no issues. Just recently after migrating to another server I have encountered a strange problem, and, am finding it really difficult to solve.

    I have the following wp_query

    $args = array(
        'post_type' => 'features',
        'posts_per_page' => 5,
        'tax_query' => array(
                'taxonomy' => 'regions',
                'field' => 'id',
                'terms' => 75,
    // set query based on the above parameters
    $wp_query = new WP_Query($args);

    Now this was working fine before the website was moved, now, however, this query seems to be querying a lot of stuff unrelated to the region with field id = 75 – other ids seems to be creeping into the query. I have a number of tax_queries throughout the site all of which seem to be suffering the same problem.

    Any help Re. this would be much appreciated.



    According to documentation, the field has to be one of these:
    – ‘term_id’
    – ‘name’
    – ‘slug’

    I’m not too familiar with it, but maybe try replacing:

    ‘field’ => ‘id’,


    ‘field’ => ‘term_id’,

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.