Title: class-wp-query.php problem
Last modified: October 10, 2017

---

# class-wp-query.php problem

 *  [grigoriy1991](https://wordpress.org/support/users/grigoriy1991/)
 * (@grigoriy1991)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/class-wp-query-php-problem/)
 * wp-includes/class-wp-query.php
    line 1938
 * **$q[‘pagename’] = sanitize_title_for_query( wp_basename( $q[‘pagename’] ) );**
 * Why do the wordpress try to basepath entered url address?
    I have `/caterpillar`
   but not `brands/caterpillar`, wordpress is returning 301 to `/caterpillar` that
   creates possible SEO duplicates.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fclass-wp-query-php-problem%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/class-wp-query-php-problem/#post-9574789)
 * Every WP resource has a canonical URL that WP attempts to get to no matter what
   you enter as an URL. It’s essentially correcting your improper URL, even if it
   is the one you desire. WP desires we always use canonical URLs.
 * As long as your theme in outputting a canonical meta link for every resource,
   you will not have problems with SEO duplicates because all “duplicates” will 
   have the same canonical URL regardless of the URL used to get there.

Viewing 1 replies (of 1 total)

The topic ‘class-wp-query.php problem’ is closed to new replies.

## Tags

 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/class-wp-query-php-problem/#post-9574789)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
