I'm finding some strange query strings on my homepage are indexed in Google and causing duplicate content. A couple of examples: https://sciencetrends.com/page/103/?cat=-1 https://sciencetrends.com/?cat=-3

I'm not sure how or why these pages are being created in Wordpress but it seems common for even large Wordpress sites: https://techcrunch.com/page/10/?cat=-1 https://blogs.wsj.com/law/page/10/?cat=-1 https://www.nytco.com/page/10/?cat=-1 http://www.bbcamerica.com/page/10/?cat=-1

Ideally, I'd like to remove all ?cat=* pages from the site and have then resolve to 404. Any thoughts on the best method to do so, .htaccess, Wordpress modification, etc.?

1 Answer 1

if (isset($_GET['cat']) && $_GET['cat'] == -1) {
      header('Location: 404.php');

Add this to your function.php file.

I also faced the same issue on my website. Every time I published a new article, the URL was not getting indexed in search engine and instead of URL, this unknown category shows up: (?cat=-1)

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.