How to track 404 pages and redirect them in WordPress

179

It can be a challenge to move your website from one location to another if you don’t know what to do with your links. Just recently we talked about how you can update your URLs using the Velvet Blues Plugin for WordPress. But what if people try to access a page on your site through your old URL? Today we are going to show you how to redirect broken URLs to your new URL. The best part about is that you don’t have to know anything about your .htaccess file. Redirection is a WordPress plugin that manages 301 redirections, keep track of 404 errors, and generally tidy up any loose ends your site may have.

Video Tutorial

Subscribe to WPBeginner

If you don’t like the video or need more instructions, then continue reading.

First thing you need to do is install and activate Redirection plugin. Upon activation, go to Tools » Redirection to set up your redirects.

Adding a new redirect in WordPress with Redirection plugin

Under the add new redirect section simply add the old URL which is showing 404 and a new URL where users will be redirected.

For beginners, this simple screen can look confusing. Let us explain. The match dropdown has a few options. URL only, URL and referrer, URL and useragent, and URL and login status.

In most cases, you want to use URL and referrer. Mainly because if you are seeing a number of 404 requests for a specific page, it is not users typing your URL in. It has to be someone who is linking to it.

So now whenever someone else links to the broken URL (or a post that you moved), it automatically redirects them to the new location. So use URL and referrer option for that.

Your action should always be Redirect to URL, unless you know what you are doing.

After you have entered this information hit “add redirection”. Go to the new URL to test and make sure that it works.

Redirection plugin also has the option to track 404s. Simply click on the 404s link at the top and plugin will show you recent 404 errors occurred on your site since you installed the plugin.

Track 404 errors in WordPress with Redirection plugin

You can take a look at the ones and determine what to do about them. For example, someone might be linking to your older post that you no longer have. You can redirect those to another location. All you have to do is click the ‘Add redirection’ link below the date of that log entry.

These logs will also reveal how people are trying to attack your site. We get tons of 404 inquiries from bots that are trying to try every single theme with timthumb infection. Hoping that they will find something (they won’t). But it’s interesting to see all the IPs that are trying things.

This plugin also handles redirection for your modified posts. If you modified your post’s URL, then this plugin sets up an automatic redirect. It is one of the MUST have plugins for any serious bloggers.

We hope this article helped you learn how to track 404 pages and redirect them in WordPress. You may also want to see our guide on how to fix WordPress posts returning 404 error.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.