1

I was going through the Google Search Console pages issues and one of the issue reason is "Alternate page with proper canonical tag" and this has some URLs which look like below

example.com/abc/?hstc_sdb.sdhjb16573.328y......and so on
example.com/abc/?utm_term........and son on
example.com/abc/?job... and so on
example.com/abc/?amp... and so on
example.com/abc/?hs... and so on

and many more like this, however, i am not sure from where these are coming so i though of adding queries in robots.txt for disallowing some attributes and to avoid these types of pages to be crawled by search engines (My 1st question if this is the right and good approach)

2nd questions is what can be the exact queries to be added in robots.txt for above mentioned URLs, are the below one will solve the purpose?

Disallow: /?amp
Disallow: /?hs
Disallow: /?__hstc
Disallow: /?job
Disallow: /?utm

if not what are the right queries?

Its a wordpress website

1 Answer 1

1

To answer your second question:

If the URLs are within a sub-folder like your example (example.com/abc/?amp) the following would work:

Disallow: /abc/

This follows Google's recommendations on URL matching based on path values.

If there's no subdirectory, you will need to implement a wildcard, such as:

Disallow: /?*

However, anything starting with question mark would be ignored, which perhaps isn't ideal.

Now, is this the correct approach? It's certainly going to help remove them from Google. I'd personally investigate why those URLs are appearing and try to find the cause, but this would be an appropriate interim fix.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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