WordPress Canonical Redirect for 404 Errors

Do you know that WordPress does a Canonical Redirect for URLs that return a 404 Page Not Found HTTP Error Status Code? WordPress does this by guessing the right Permalink and doing an automatic 301 Redirection to the URL so guessed. Is this a good or bad thing to do from an SEO perspective? Find that below.
WordPress Canonical Redirect for 404 Errors

What is WordPress Canonical Redirect?

WordPress has a built-in function called Redirect Canonical that 301 redirects any incoming link to the proper URL based on the site URL and the URL Path. This function also takes care of redirecting www to non-www version or vice-versa, as may be appropriate, for any incoming link that uses the wrong canonical version of the URL. It thus does a very important function of redirecting all incoming links to one or the other appropriate canonical URL, thereby preventing duplicate content. This can also be addressed by adding the following piece of code to your .htaccess file. Make sure to replace techblissonline with your domain name. This code will redirect www canonical URL s to non-www canonical URLs.

RewriteCond %{HTTP_HOST} ^www\.techblissonline\.com [NC]
RewriteRule (.*) https://techblissonline.com/$1 [R=301,L]

However, WordPress redirect_canonical function prevents redirection for trackback, feeds, admin URLs, robots.txt requests and search URLs.It is the most appropriate thing to do.

Thus it basically takes care of several useful SEO needs that include the following.

  • Redirection of www to non-www canonical URLs or viceversa i.e. non-www to www canonical URLs as per your site URL configuration
  • Stripping /index.php/ when PATHINFO permalinks are not used
  • Handling trailing slashes for all URLs on the website appropriately
  • Removing trailing spaces and end punctuation from the URL path.
  • Ignoring differences in host capitalization

But as part of SEO enhancements, the function also attempts to find the correct link when a user enters a URL that does not exist. It does this based on the exact WordPress query. It parses the URL or query in an attempt to figure the correct page to which it does a 301 redirect. It uses a function called redirect_guess_404_permalink() to figure out the page to redirect to. Unfortunately, this isn’t an ideal way to guess the correct Post. To add to the woes, WordPress does not provide any filter in this function for WordPress SEO plugins to address this appropriately.

The guessing done by WordPress is so basic that it doesn’t give users the ability to choose the appropriate URL to redirect to. For example, when an incoming link or the URL typed into the browser by a direct user is of the form https:/techblissonline.com/platinum and when there are multiple URLs on this domain https:/techblissonline.com/ starting with “platinum” as a slug (or Post Name), WordPress will by default redirect to the earliest published Post that had “platinum” as the first word in the Post Name or slug. This will not be good from an SEO perspective as users may several times be automatically redirected to irrelevant Posts that does not satisfy their Query intent. As a result, users will bounce back to Google SERPs (Search Engine Result Pages) and search for other pages that satisfy their intent.

How does Platinum SEO Plugin help to address incorrect canonical redirects done by WordPress?

disable-wordpress-redirect-permalink-guess-for-404-url

Platinum SEO WordPress Plugin now provides users the ability to prevent incorrect canonical redirects by WordPress. You can enable this option by navigating to Permalinks tab in the Plugin Settings i.e. Platinum SEO and Social Pack -> SEO -> Permalinks. It thus provides users the option to disable canonical redirect to incorrect Permalink determined by the WordPress 404 permalink redirect guessing function (redirect_guess_404_permalink).

However, other useful functionalities of redirect_canonical function will continue to work as usual. By disabling the guessing done by WordPress, Platinum SEO Pack lets its users to define the more appropriate URL to redirect to using any of the HTTP Redirect Status Codes, including 301 and 302, for redirection. Users can define this redirection through the 404 Manager, where they first come to know of the 404 Error for an incoming link. They can also define or create any Redirection using the Platinum SEO Redirection Manager.

To understand how to do Redirection, say a 301 Redirect in WordPress, with Platinum SEO Plugin, you may read through the following:

Leave a Reply

Your email address will not be published. Required fields are marked *

*