How Long Should I Keep My Redirects?
By Matthew Edgar · Last Updated: August 07, 2019
Once you have added a redirect to your website, how long should you keep that redirect active on your server?
Let’s start with a purist approach. If the redirect uses 301 HTTP response status code, then that response status code means the redirect is permanent and, as a result, you should keep the redirect forever. Of course, it is difficult to maintain something in your code indefinitely. With every server transfer, website redevelopment, or content migration, do you have to invest the time, money, and effort to transfer and maintain every single redirect?
Let’s try a different approach to answering this question. According to Google’s John Mueller, Google will recognize the redirect within 6 months to 1 year. But, is Google the only audience you are adding redirects for? You might have a redirect established for a link contained in offline marketing, emails, or ads—is 6 months to a year enough time to maintain those types of redirects?
As with many aspects of managing a website, there is no universal answer for how long you should keep your redirect. The length is dependent on the nature of each individual redirect and how that redirect is used. Instead of a universal answer, let’s review the steps you need to take to determine how long any given redirect needs to stay on your website.
- Does the redirected URL have traffic?
- Does the redirected URL have backlinks?
Keeping a Redirect: Criteria
There are two main factors to consider to determine how long each redirect should be kept:
- Does the redirected URL have traffic?
- Does the redirected URL have backlinks?
If the answer to either question is yes, then the redirect should be kept. Let’s walk through the steps you need to take to obtain information about the traffic or links going to redirected URLs.
Evaluating Traffic to Redirected URLs
The first question to consider is if the redirected URL is used by anybody, bots or humans, to reach your website. A redirect that hasn’t received any traffic (or not much traffic) within the last several months likely no longer needs to be maintained. There are two ways of measuring traffic to redirected URLs: log file analysis and Google Analytics UTM parameters. Of course, it isn’t just about the traffic you have; you also want to consider potential traffic too.
Method #1: Log File Analysis
The first way of determining if a redirected URL is continuing to get traffic is by reviewing your website’s log file. The web log stores information about each request made to your web server, including requests made to redirected URLs.
Step #1: Download Log File
Every hosting company maintains some type of log file about visitor access, though it varies how many long log files are stored—some hosting companies only provide the last 24 hours’ worth of data, while others give you the prior month’s log file. To understand something like redirect usage, you may need more data than your hosting company stores by default. As a result, you can download your log files on a regular basis so that you can have more data to evaluate.
For example, our hosting company at Elementive only keeps one-month worth of logs, so we download our log files every month. That way, we can review 3 or 4 months of log files when we need to review how many people are using redirects.
(Side note: Log files contain user IP addresses, which are considered personally identifiable and, therefore, make log files subject to rules and regulations about privacy. Please keep this is mind when downloading and saving log files, so that you can respect the privacy rules your website is subject to.)
How you find and download your web log file depends on where your website is hosted. A few common sources:
- WP Engine. Access logs are available within the user portal.
- IIS. Typically stores in a central location.
- Apache servers, or servers with cPanel. Stores in a central location, or you can find access logs on the main cPanel interface.
Step #2: Opening Access Logs
The next step is opening the access log. Typically, log files are compressed as TAR or GZIP files and you’ll need a program like 7-Zip to extract. Once extracted, there are a variety of ways to open the log file. In this case, let’s take the easiest: Excel.
Now that we have it open, let’s talk about how you can read a log file. Here is an entry from Elementive’s log file
123.456.789.001 - - [30/Jun/2019:13:06:49 -0700] "GET /google-analytics-viewport-or-browser-size/ HTTP/1.1" 200 11306 "https://www.google.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15"
Let’s pull out the two key pieces of information we care about to evaluate redirects:
- “/google-analytics-viewport-or-browser-size/” – the user requested a page on Elementive’s site with the URL google-analytics-viewport-or-browser-size
- 200 – this is the HTTP response status code. A 200 indicates the page loaded normally.
For more information about the file, check out Wikipedia’s entry about log formats.
Step #3: Finding the Redirects
Now that we know how to open and read our log file, let’s find the redirects. Assuming we have the log file open in Excel, we can filter through the log file entries to find 301 redirects. Begin, by setting up filtering in Excel and adding a text filter.
We want to filter for anything containing a 301. Note that we want to find a “301” after the quote and the 301 should have two spaces around it. That differentiates the response status code from all the other information within the log file.
Next, we want to get the individual URLs. In the cell next to the log entry, put the formula:
This will extract the URL from in between the HTTP protocol statement and the GET command.
Step #4: Count Redirected URLs
Finally, we can now go through that list of URLs and count how often each URL occurs. In Elementive’s case, in the last 24 hours, here were our top redirected URLs. Given this volume of traffic, we would likely want to maintain these redirects. However, any redirects we have established that are not found on our log file, or are not found in sufficient quantity on our log file, would be ones to consider no longer keeping.
|Redirected URL||Access Log Count|
Method #2: Google Analytics
We can also track redirects using Google Analytics. This requires more upfront setup but can be easier to identify redirect usage than when using log files. It really breaks down into two simple steps: adding the tracking and reviewing the data.
Step #1: Add UTM Tracking to Redirects
We can add UTM tracking parameters to the redirect destination.* For example, if I want mysite.com/a.html to redirect to mysite.com/b.html, and want to know how many people use this redirect, I could add UTM parameters onto mysite.com/b.html. That would mean I’d be redirecting from mysite.com/a.html to mysite.com/b.html?utm_source=a.html&utm_medium=redirect. The additional information added to the end of that URL wouldn’t affect visitors or affect SEO—but it would let me know how many people used redirects in Google Analytics to access my website.
This is especially helpful when you are redirecting one domain to another. For example, I redirect my old company’s URL of qwconsulting.com to matthewedgar.net and I’d like to know how many people still use that redirect. These kinds of redirects are harder to track in log files. As well, these types of redirects are usually more expensive since you have to pay for the secondary domain you redirect to your main domain, so you want an easy way to measure the return on that investment in the secondary domain.
Here is a video I recorded discussing the process of setting up redirects with trackable parameters, including more reasons why you may want to do this.
*Note: Make sure this is only applied to redirects external to your website. If a link contained on your website redirects and is tracked in this way, you would distort your traffic source reports.
Step #2: Review Redirect Usage
Then, after the redirect is established, you can go to Google Analytics to review. In the sidebar, click on Acquisition, then All Traffic, then Source/Medium.
In this table, search for all redirects or a specific redirect. For example, 14 people have used the redirect from my book’s domain, successfulwebsiteelements.com to reach my website. To me, this is enough traffic over this time range to justify keeping that redirect in place.
Other Consideration: Traffic Potential
A redirected URL may not have traffic now, but it might have traffic in the future. If that potential traffic is particularly valuable, you wouldn’t want to get rid of the redirect and risk losing that traffic.
For example, although my domain for my website is matthewedgar.net, you can also reach my website by going to matthewedgar.com. The domain matthewedgar.com then redirects to matthewedgar.net. In all the years I’ve had this setup, only a dozen people have used matthewedgar.com to access my website, but one of the ones who did is now one of Elementive’s best clients. That means the redirect could lead to highly valuable traffic and it is worth maintaining even though this traffic wouldn’t be reflected in logs or Google Analytics data.
Before you delete a redirect simply because it lacks traffic, stop to consider who might use that redirect in the future. If even one or two people use that redirect in the next five years, could it lead to something valuable? If so, keep the redirect. If there isn’t any potential for the redirect to be used, then remove it.
Finding Backlinks to Redirected URLs
The second question to consider is if people out on the web still linking to the redirected URL. If people are still linking to the URL, those links still are providing some value—either by sending traffic through that redirected URL to your website or by helping your SEO. As a result, redirects with backlinks should almost always be maintained.
Step #1: Find the Backlinks
To begin, we want to find the backlinks pointing to 301 redirects. There are a variety of tools available to help us do this, including Moz, Ahrefs, and Majestic. All three tools work in slightly different but all give you a way to review who is linking to you. I’ve found Moz’s Link Explorer to be the easiest tool to work with for this, so that’s the one I’ll use in this example—though, realistically, you’d want to aggregate data from all tools to make sure you have a complete understanding of the redirected URLs.
In Moz, search for your domain and then go to top pages. Then export the list of all top pages. This export will include the response status code.
Step #2: Filter Links to Find 301 Redirects
Once you’ve downloaded and opened in Excel, you can add filters and narrow down to view only those links with 301 HTTP response status codes.
Step #3: Review, Count, & Verify
Similar to traffic, you’ll then want to count up the amount of links each redirected URL has. For those with lots of links, it is also important to explore which websites link to that redirected URL using Moz, Ahrefs, and Majestic. As you review the specific links referencing that redirected URL, check to see if the source page still contains the redirected URL as sometimes Moz, Ahrefs, Majestic, or other similar tools have outdated link information.
For example, in reviewing these backlink tools, I found that this domain links to a redirected URL on Elementive’s website. But, when I go to the source page supposedly containing the link, the source page is no longer working.
As you review the links, update the link tallies to get a complete picture of how many links each redirected URL actually has.
How Much Traffic? How Many Links?
Inevitably, the question the above steps lead you to is how much traffic or links are enough to warrant keeping the URL? One visit per month on a redirect may not be enough to make keeping the redirect worth it, especially if there is a cost associated with that redirect (such as when you are paying for a secondary domain to redirect to your main domain). However, if that one visitor who came in on the redirect converted, and that conversion led to a large sale for your company, perhaps it is worth it.
The same is true of backlinks. If a redirect only has six linking root domains, that might not be worth keeping if your domain already has millions of other linking root domains. But, if your domain only has 50 linking root domains, those six domains linking to the redirect matter a great deal to your overall link profile.
As well, if one of those six linking root domains is a high authority website, the value of that high authority site’s link is likely greater than many of the other links in the domain’s link profile—that would almost always make the redirect worth keeping.
How Often To Check?
A second question is how often you need to check redirects and determine if they should be kept. This only really matters if you have lots of redirects. For sites with less than 5,000-10,000 redirects, I wouldn’t worry about evaluating the need for redirects until you are moving to a different content management system, migrating hosts, or some other type of system overhaul. For sites with more than 10,000 redirects, I would check your redirects and evaluate the need for each redirect at least once per year (more often if you have even more redirects than that).
On a more regular basis, perhaps quarterly or month, you do want to review your backlinks to see what links to redirected URLs you can update so that you aren’t relying on the redirect. If there are any links within your control that go to a redirect, update those to go the main source—removing redirects can improve the speed of the page being linked to and also cut down on how many redirects you ultimately need. If you find that external websites are linking to redirected URLs on your website, reach out to those webmasters and ask if they change the link to go somewhere other than the redirected URL.
Ultimately, you want to keep redirects for as long as the redirect is useful. “Useful”, in this case, is defined as the redirect delivering traffic (or having the potential to do so) and the redirect having backlinks (or at least having backlinks worth keeping). In some cases, that redirect will be useful for a few days and in other cases, that redirect will be useful for years.