3

I have a WordPress site is running on my domain. There are some pages that are indexed and cached by Google with query string like this: example.com/category/xxx/?post_type=product.

I want Google to index that page, but without the query string. How can I make Google cache example.com/category/xxx (without the query string post_type). I want Google to stop indexing any pages on the site that have a query string. None of the query strings on my site actually change the content of the pages.

Should I redirect to remove the query string? How would I do that?

3 Answers 3

2

You can instruct Google how to treat urls with parameters, they have a tool for that in Google Search Console.

They are passive parameters if they do not change content on a page.

If you categorize the parameter and add a rel canonical tag for the non paramatized url, then the non parametized url is what should appear in the search results.

https://support.google.com/webmasters/answer/6080550?hl=en

0

There are several solutions. The easiest would be to put canonical URLs in your pages. That lets Google know which URL is the correct one that should be indexed. There are several plugins like Yoast for WordPress that will do that for you.

Another solution would be to disallow Google from crawling URLs with query strings. You could do so by creating a robots.txt file like:

User-Agent: *
Disallow: /*?

You could also put in redirects, but implementing them is a bit harder than other solutions.

-1

I think you mean how Google crawls.

Google crawls based on website configuration. Meaning if your final display URL would be with parameters then it will crawl accordingly.

If you want clean URL then change the settings in WordPress.

Path: WordPress Admin >> Settings >> Permalinks and choose the format you wish to keep.

If your question is different then you may need to explain slightly more in detail.

Hope this helps.

3
  • Hi, thanks for your answer. I set customer permalink that () in WP Admin. Infact, Google indexes my page example.com/category/table/?post_type=product - it haves the query string. Now, I want Google stop indexing the above page and indexes the page example.com/category/table/ (no query string).
    – Cuong Phan
    May 8, 2017 at 12:49
  • The "clean url" setting in wordpress doesn't redirect non-clean URLs. This answer doesn't look very helpful. Jun 1, 2017 at 20:49
  • If setup to display clean URL then URL with query string gets redirected to clean URL in the WordPress. Example: example.com/?page_id=9 would get redirected to example.com/page-url
    – TopQnA
    Jun 2, 2017 at 2:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.