WordPress – “Duplicate without user-selected canonical” error – /page/2?cat=-1

Google sent me this warning;

It turns out that WordPress is creating /page/2 and /page/2?cat=-1

Add this to your themes function file to fix.  It is also possible to do a rewrite through nginx or apache, but this is closer to the problem.


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

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.