How Trailing Slashes Affect Your Website’s SEO
A trailing slash at the end of a URL on your website can cause issues with duplicate content if not dealt with correctly. Put simply, Google doesn’t like seeing the same content on different pages. It can be confusing for both search engines and users. Having the same page load whether you add the trailing slash or not, means Google is seeing two pages with the same content.
What is a trailing slash?
A trailing slash is a forward slash placed at the end of a URL. It's usually used to indicate a directory (as opposed to a file), but in SEO it can affect your rankings. Take a look at the URLs below and guess which one is ‘correct’. Note that one of them has a trailing slash at the end.
Click on them and they both go to the same place. The only difference is that little, seemingly insignificant trailing slash. Surely that doesn’t matter. It’s the same thing, right?
First of all, they only go to the same web page because we set it up that way. A 301 redirect has been placed on the first link, that sends you to the second URL. Does your website do the same? Test a few pages of your website by entering a URL with a trailing slash, and then the same one without. Check pages other than the homepage as well.
If your browser can load a version of the page with a trailing slash, and one without, you could be committing one of the most common mistakes in SEO.
How can trailing slashes in URLs cause problems?
There are multiple reasons why trailing slashes need to be dealt with correctly. At a fundamental level, Google crawls and ranks individual URLs. This means they have to be unique. If the same page can load on two different URLs we run into duplicate content issues. It may look almost identical, and technically it may work perfectly, but it is not optimised for search.
Trailing slashes can split your link equity in half
Link equity, often referred to as ‘link juice’, is an SEO ranking factor. It’s the idea that when web pages link to other pages, they’re endorsing that content by transferring link equity. The more link equity a page has, the more powerful the endorsement. It’s the underlying principle behind ‘PageRank’, one of Google’s original algorithms.
Having two versions of the same page live on two different URLs makes it confusing for someone trying to link to your page. Do they use the trailing slash, or not? A choice must be made. If 50% of people link to the URL with a trailing slash, and 50% don’t add one, then your link equity is being split in half.
Trailing slashes can be bad for crawl efficiency
Google doesn’t crawl your whole site every day. A crawl budget determines how much of your website will be explored and indexed. For small sites, this isn’t a big deal, anything under 100 pages is likely to be crawled. For larger sites with thousands of pages however, it becomes another area that must be optimised. The size of the crawl budget for your website is determined by a number of factors including:
- Size of website (how many URLs are there to crawl in total).
- Health of website (how many errors Google finds).
- Links to website (how many backlinks you have, and which URLs they link to).
Duplicate content caused by incorrectly managed trailing slashes causes Google to unnecessarily crawl multiple versions of the same page. While you’re unlikely to be manually penalised for this sort of duplicate content, it’s still making the search engine’s job slightly more difficult. Ignoring duplicate content from trailing slashes is essentially the opposite of SEO.
Trailing slashes can be bad for the user experience
User experience (or UX) is half the battle of SEO. A good user experience means that people will stay on your website for longer, and engage with it (click on things) more. This sort of activity sends strong signals to Google that your site is worth ranking.
Whether a URL has a trailing slash or not, it’s viewed as a unique and individual web page. If the same URL exists both with a trailing slash and without one, it means the content on the page could technically be different. In most trailing slash cases the page are identical, but with the amount of people who work on websites, all making tweaks and sometimes injecting custom code, you can’t guarantee they’ll stay the same forever.
The longer two separate URLs exist for one page, the higher the chances of their individual content changing. Now think about how confusing it would be for a user to stumble across both versions, or to follow a link from an external site to an older version of your page. Ignoring trailing slash issues just makes things more difficult for everyone: the user, search engines, and anyone else dealing with your website.
Google tells you to fix trailing slash issues
If you need even more convincing that trailing slashes should have a fixed convention on your site, then just have a read of Google’s own blog on the topic. They go into a lot of detail and provide examples but the gist of it is that while it’s not going to cause any technical issues, it’s best practice to maintain a trailing slash convention and apply redirects where necessary.
The final sentence in the post really drives the point home, explaining that if you apply a fix for trailing slash issues, “You can bask in the sunshine of your efficient server configuration, warmed by the knowledge that your site is better optimized.”
They’ve put the word “optimized” right there. There’s a lot of mystery around SEO and ranking factor importance, as Google don’t officially reveal how their algorithm works. If Google then publish a post that tells you that a certain action will optimise your website, then it’s a no-brainer to follow their advice.
How do I fix a trailing slash issue?
Before fixing any trailing slash issues on your website you’ll need to decide which URL structure you prefer. Feel free to pick either one, but this could be a decision influenced by your existing website structure. For websites with a directory structure, it makes sense to use a trailing slash. Whatever you decide, the important part is sticking with the same convention across your whole website.
The good news is that it’s not too difficult to fix issues with trailing slashes, depending on your website platform. It’s important to note that root domain (often the homepage - in our case https://www.onlineassetpartners.co.nz) will always resolve without a trailing slash. Google does this automatically, and you won’t be able to change it.
A 301 redirect is the best way to resolve duplicate content issues caused by trailing slashes. If you’re just fixing one page, you’d redirect the duplicate copy to the version that matches your chosen URL structure.
Most trailing slash issues however, affect many pages across a website. Redirecting each individual page would be time consuming, so a site-wide redirect is often the way to go. This method will also prevent the issue from cropping up again in the future.
In rare cases, a 301 redirect is not possible or you may have reasons for avoiding it. In these situations, a canonical tag will resolve most issues. The tag rel= “canonical”, can be used to indicate to website crawlers the ‘true’ or ‘original’ version of a page. If you can’t redirect a page, a canonical tag will at least fix any duplicate content issues in the eyes of search engines.
The downside to just using a canonical tag is that it doesn’t fix some of the other issues associated with incorrect trailing slash convention. Users may still get confused, crawl budget will remain unoptimised, and links may still exist to both versions of the page. Only use canonical tags to fix trailing slash issues when redirecting is not an option.
Ongoing maintenance for trailing slash issues
After you’ve implemented your trailing slash convention and fixed any existing issues, there are a few things you can do to keep the problem from returning.
- Update your sitemap regularly - ensure your sitemap always lists the correctly structured URLs.
- Use Google’s URL inspection tool - check which version of your important pages are being indexed.
- Search console coverage - this view in Google Search Console will highlight any errors flagged during a site crawl.
SEO is about sweating the details. There are so many ranking factors to optimise, each with varying degrees of importance. Of course it’s important to allocate resource wisely, but ignoring duplicate content issues and trailing slash convention is shooting yourself in the foot.
It’s an issue that can confuse search engine robots and humans alike. Left untreated, it will cause even more problems down the road. Despite trailing slash issues being so easy to diagnose and fix, we still see it across a huge number of our clients. If you have questions around trailing slashes, duplicate content, or SEO in general, please get in touch.
This article was published in June 2019. Last updated February 2022.