Search engines and users look at your URLs to understand what your pages are about and how they should move through your website.
To make both of their jobs easier, you should ensure that your URLs are:
- Relevant to the page’s content,
- Easy to read.
In this article, I will focus on steps you can take to ensure your URLs match all of the above.
I will describe how URLs are built, why an SEO-friendly URL structure is important, and how to structure your URLs to help users and search engines.
What is an URL
A URL, which stands for Uniform Resource Locator, is the address of a resource located on the web.
Each URL should point to a unique resource, such as an HTML page, a PDF, or an image. However, visiting some URLs can redirect users to content that has been moved or does not exist anymore.
Let’s have a closer look at what an URL is made up of.
Each URL can consist of the following elements:
- The scheme tells the servers which protocol to use when accessing a page on this website. Most websites today use the HTTPS protocol.
- The subdomain is an extension of your domain that helps organize and separate different sections of a site. It’s an optional element of an URL. Sites can have subdomains dedicated to sections such as “blog” or “shop,” and they can also host their mobile sites on “m.” subdomains. One of the more popular subdomains is www.
- The domain can be divided into second-level and top-level domains. The second-level domain is the website’s name, while the top-level domain is the domain’s extension, like “.com” or “.org.”
- The port determines what gates browsers need to connect to in order to access resources on a server. However, this element does not appear frequently as most sites use either HTTP (which uses a standard 80 port) or HTTPS (443 port).
- The path shows the route in the site’s navigational structure that leads to the resource or file on the server. A path could look like this: /path/to/myfile.html.
- Parameters are additional values that typically appear in a URL after a “?” symbol. You can include several parameters by joining them with ‘&.’ Parameters can be search terms, numbers, encrypted values, or other data. They could be structured like this: ?key1=value1&key2=value2.
- Fragments are internal referrers on a page. They are preceded by a hash and indicate a part of the resource that the browser should direct to, such as #fragmentidentifier. For example, it could be an anchor in a text or a specific moment in a video.
How URL structure impacts SEO
By following best practices in structuring your URLs, you help search engines find and retrieve your pages more efficiently and accurately. This makes them more likely to index the right pages on your site.
By optimizing your URL structure, you avoid risking the following issues:
- Google may assume two URLs have the same content because it can only retrieve one URL and considers the other one a duplicate. However, the content on these two URLs may differ – as a result, crawlers may miss some of your site’s content. According to Google, this can occur, e.g., in URLs containing fragment identifiers.
- Google can assume two or more URLs are different and crawl them, but their content is the same. This could occur if you have inconsistent URLs that differ and don’t help Google determine that they both redirect to, for example, the same product. In this situation, Googlebot will spend additional time and resources to crawl many versions of the same page, which can slow down the crawling of your site.
Also, it may cause Google to choose a different canonical version than you want it to – here’s how to fix it.
- Google may think your site consists of an infinite number of pages. For example, this could occur if your URLs include values that change, such as timestamps. Google will need to spend more time crawling your site and looking for valuable content in this situation.
Planning the structure of your URLs
First of all, you may decide to structure your URLs differently depending on the type of website you have and what purpose it serves users.
For instance, a different structure may be appropriate for eCommerce sites and blogs.
Your URL structure may also depend on whether your content exists in a few languages or if your store operates in international markets.
When planning your URL structure, keep each URL’s length to a minimum. Shorter URLs are easier to read by people and robots and, if designed correctly, can have a more specific meaning than long ones.
In a 2020 study, Backlinko found a correlation between the length of an URL and position in Google SERPs. Though the correlation was not major, they did discover that shorter URLs were more likely to rank higher. This doesn’t mean Google favors short URLs in ranking, but you can think of it as a best practice that top-ranking websites use.
You need to ensure your URLs reflect your website’s structure and hierarchy.
Your site architecture plays an important role here. If it’s not intuitive, it will be harder for users to complete their desired actions, and you will find it challenging to keep a consistent URL structure that makes the whole website look good.
So, how should you go about adjusting your URLs and making them SEO-friendly?
How to create SEO-friendly URLs
In structuring your URLs, you need to consider their aspects and elements they contain, such as:
- HTTPS and HTTP protocol,
- Subfolders and subdomains,
- Trailing slashes,
- Internal linking,
- International SEO,
- Words to omit or remove,
- Capitalization of letters,
- Hyphens vs. underscores,
- Non-Latin and special characters.
I will explain the best practices concerning these aspects that you should follow to help users who visit your website and search engines that crawl and index it.
HTTPS and HTTP protocol
Switching from HTTP to the HTTPS protocol is necessary today, and most sites moved to HTTPS a while ago. HTTPS protocol ensures a more secure way of transmitting data between a site and users. Google considers whether a site uses HTTPS for ranking purposes. If you are still using HTTP, make the move to HTTPS.
Subfolders and subdomains
Subfolders and subdomains should be implemented depending on your use case.
Subdomains will be a better choice if you want to separate sections of your site from the domain so they are not viewed as one entity. This can be done, e.g., if your subdomain will have different content than the domain or serve a largely different purpose.
Meanwhile, subfolders are located within the domain’s hierarchy, so are better for organizing similar content on a site.
Another case is a www subdomain. Whether you include www or not is irrelevant for SEO purposes, but it’s essential to keep it consistent, so the best practice is to stick to either only www or non-www and redirect to the version you choose from the version you don’t.
When redirecting, watch out for potential URL structure mistakes, as they may contribute to redirect errors in your Google Search Console.
However, most sites today don’t use www. Moreover, Google Chrome does not display www in the address bar. You can keep your URLs shorter and cleaner if you choose non-www.
A trailing slash is the “/” symbol that can appear at the end of an URL. For SEO, it doesn’t matter if you include trailing slashes in URLs but be sure to stay consistent across all of your pages.
Generally, whether a root domain uses domain.com or domain.com/ is not relevant – they will be treated the same.
However, if trailing slashes appear elsewhere in a URL, each version – e.g., domain.com/page and domain.com/page/ – can be treated as a separate URL.
If there are both trailing slash and non-trailing slash versions of your pages, they may be treated as separate URLs, creating duplicate content. Use canonical tags to specify the preferred URL version.
Parameters, or query strings, comprise the parameter proper and a value, separated by an equal sign ‘=.’
They generally look messy to users, but they are an easy way to indicate filtered or sorted results on category pages, though this can create duplicate content. Make sure only one version of each of your category pages is indexable.
Another case is when sites use it for tracking.
Some eCommerce sites include a parameter with the slug of a referring page or the name of a page element that the click came from (main menu, breadcrumbs, and such) – but that’s used for tracking, and they don’t change the content displayed on the destination page in any way. Watch out, so it doesn’t waste your crawl budget.
If the parameters do not change the content on the page, setting up rel=canonical can help with having only one static URL indexed (it’s likely that Google will respect the canonicalization).
Pages with parameters will rarely have search demand, and users can create a practically unlimited number of variants with little logical difference.
You may want to limit how URLs with parameters are accessible to Google. First, decide if they even need to be crawled. If those pages are already indexed, to limit index bloat and keep them from getting indexed, use a meta robots noindex directive before taking measures to limit their crawlability (disallow rule in robots.txt file).
When parameters change the content on the page, you have to consider whether you want them indexed. For example, if users can generate URLs with four or more filters, it might lead to creating many URLs without much value, the crawling of which can waste your crawl budget.
The goal is to prevent Googlebot from even crawling those heavily parameterized URLs that change content on the page. However, the “disallow” directive in robots.txt doesn’t prevent the URLs themselves from getting indexed, especially if frequently linked on-site, for example, in faceted navigation.
Nonetheless, there are also cases where the URL with a parameter can be indexable because it has a search demand. For example, domain.com/dresses?color=red will target “red dresses” and you may decide that it should appear in search results.
Your internal linking choice is another aspect to consider in your URL structure. You can decide between using absolute or relative URLs.
Absolute URLs include the whole page address, including the domain name and protocol, for example https://example.com/blog/article.html.
Relative URLs use only point to a specific file or a path to it, such as /blog/article.html.
Whether you choose absolute or relative URLs does not affect SEO, and both solutions can be a viable option for your site. Here are their upsides and downsides:
|Absolute URLs:||Relative URLs:|
The choice depends on your use case:
- Absolute URLs should be used in, e.g., XML sitemaps, canonical URLs, hreflang tags, and when linking to external pages. Generally, absolute URLs are a better choice when you want to make it clear what the location of a page is to avoid any confusion from search engines.
- Relative URLs are a better choice when linking to pages or files located within your site. This solution makes it easier when you decide to, e.g., change your domain name, because you don’t need to find and update each URL separately.
Contact us to resolve this and other internal linking dilemmas and take advantage of Onely’s internal linking optimization services.
If your company operates in different countries and targets people speaking various languages, you will need to adjust some aspects of your site that are important for international SEO, such as your URL structure.
Your URL or domain structure should reflect the different language versions of your website.
When planning a domain structure, you can choose from a few options – let’s explore them.
In this case, you create different domains with country-code Top-Level Domains, which are two-letter codes specifying which country or region each site is targeting. These URLs can look like this: www.example.fr, www.example.eu, or www.example.co.uk.
What is relevant about this solution is these domains target geographic areas as opposed to languages. Using ccTLDs is one of the strongest signals for search engines and users on what region the site is dedicated to.
However, each domain collects ranking signals separately. Another downside is that you will be required to set up and maintain a few different domains which can be time-consuming and costly.
gTLD with language parameters
This solution entails using a global Top-Level-Domain, such as example.net or example.com, and adding parameters specifying the languages that each site version is targeting.
These URLs can look like this: www.example.com?hl=es or www.example.com?hl=en.
It’s an easy solution to set up but it makes the URL look messy and is generally not recommended by Google.
Subfolders under gTLD
In this case, you create subfolders for specific languages under a global Top-Level Domain. Here are some examples: www.example.com/de, www.example.com/en, or www.example.com/es.
Subfolders are not treated as separate entities by Google, and they are easy to set up and manage. It’s a great way to expand into a new market while keeping your ranking signals and brand image.
Subdomains under gTLD
Here you use subdomains with a gTLD, such as en.example.com, which lets you target a specific language.
Keep in mind that search engines may treat a subdomain as separate from a site’s domain and the ranking signals it collected.
Which international SEO solution to choose?
We usually recommend choosing one of these two variants for your international SEO solution:
- separate domains for every country (like Amazon), or
- one strong global domain for all languages (like Wikipedia).
Google’s John Mueller was asked about keywords in URLs on many occasions. Each time, his responses were similar.
For instance, during a Google Webmaster Central hangout in 2016, when asked about keywords in URLs as ranking factors, John said:
I believe that’s a very small ranking factor, so it’s not something I’d really try to force. And it’s not something where I’d say it’s even worth your effort to kind of restructure your site just so you can include keywords in the URL.source: John Mueller
Make sure URLs are descriptive, but steer clear of writing for robots; for example, including multiple variants of keyword phrases in a URL just to include them. This can work against you if Google considers it irrelevant to the site’s content. You should only include the keywords you are targeting in your URLs to describe your page most accurately.
At Onely, we don’t identify keywords in URLs as a ranking factor at all. Instead, if URLs are placed on a page and linking to other content, we view the anchor text of a link and its surrounding words as much more important.
Words to omit or remove
It’s best to omit stop words in URLs, such as “the,” “and,” “or,” “of,” “an,” “to,” etc. They don’t add meaning, and by avoiding them, you can keep the URLs shorter. You should also remove any redundant words – focus on only including words that describe the core of the page’s content.
Depending on the type of content, you should consider making your URLs durable, which is particularly important for evergreen content. A durable URL will typically not contain elements such as dates, adjectives, or author names.
For example, if you are writing a blog post that focuses on a specific year, include it in your title, but not necessarily the URL. It’s a much better choice as it allows you to make minor updates to the content or even change it in later years to reflect how the topic may have changed.
Capitalization of letters
It’s generally recommended to use lowercase letters in URLs, and this is what most sites do. It’s also expected that most people linking to your URLs or typing URLs into search bars will be using lowercase. URLs with uppercase letters or all caps tend to appear messy and are less readable.
When it comes to SEO, Google views URLs as case-sensitive. Because of that, if you use lowercase URLs in addition to capitalizations, you may end up creating duplicate content. With two versions of a page, Google can end up splitting ranking signals between the two.
It’s especially dangerous if you link to both versions of the same URL without paying attention to the casing you’re using. If you notice any indexed pages with the wrong casing, e.g., because someone is linking to it, remember to 301 redirect them to the correct version.
Regardless of whether you end up choosing lowercase or uppercase letters in your URLs, the bottom line is keeping it consistent.
Hyphens instead of underscores
The important thing is to separate your words with punctuation and not justlistthemwithoutspaces. Using punctuation helps both users and search engines identify what concepts you are referring to. The preferred punctuation method in URLs is using hyphens.
Moreover, underscores may look confusing to users as hyperlinks because they aren’t visible in bare URLs:
Non-Latin and special characters
Some languages use non-Latin characters, such as ą, ę, or ó. According to Google, you can safely use them in URLs. If you include them in your domain name or top-level domain, they will be represented with Punycode encoding. Browsers and Google will treat both versions as equivalents. The rest of the URL structure can use UTF-8 encoding for these characters.
However, as John Mueller mentioned in a Google Webmaster Help thread, you should avoid using special characters such as “commas, semicolons, colons, spaces, quotes, etc.” in your URLs. They make it difficult for people to link to such URLs and look less clear to users.
Changing existing URLs vs. SEO
Keep in mind that there are always things to consider if your website is already up and running and you want to change your URL structure.
Changing your URL structure may be recommended if:
- Your structure is inconsistent or confusing,
- You have a small site,
- Your site is not ranking well.
The last point is crucial. It is probably not beneficial to make any changes if you have a lot of organic traffic.
Changing your URLs means conducting a site migration, which requires careful planning and preparation and is an error-prone process that, in case of mistakes, can lead to drops in rankings. What’s more, as part of the migration, you will have to set up a redirect for every page, which means more requests to the server.
In this situation, instead of fully changing your URL structure, you may want to gather similar pages under a category to organize your structure, as it is generally easier for traffic and server log analysis if you group content under directories.
Another thing you can do is make sure to create optimal URLs for new products and pages.
You can also contact us to help you with website migration.
- Your URL structure affects how your website is crawled, indexed, and, ultimately, ranked. Therefore, the SEO risks of having an unoptimized URL structure can be severe: Google may struggle to find all the content that you want to index.
- You may waste the crawl budget if Google needs to go through hundreds of URLs, many of which can contain identical content.
- If you don’t have a consistent URL structure, you are risking duplicate content issues.
- A messy, illogical URL structure will confuse users, especially if they see a link to your page on another website. A clean URL will be more enticing to click on and easier to link to.
- Users will be less likely to make mistakes when typing your URLs in the address bar.
Creating new URLs based on the above best practices is much easier than changing your existing URL structure. However, a complete reorganization of URLs may be necessary if you encounter serious SEO issues. If your URL structure is lacking, start planning its improvement now!
P.S. The URL for this article is a good example of an SEO-friendly URL!