URLs and SEO: Everything You Need to Know in Under 6 Minutes (2020)

Reading Time: 6 minutes

What is a URL?

A URL is a uniform resource locator, and essentially is the address of a particular web page on the Internet. All pages on the web have a URL. An example of a URL is the URL of this page, https://www.justinmckinneyseo.com/urls-and-seo/

In this concise but comprehensive guide, you’ll learn everything you need to know about URLs and SEO.

Breaking Down a URL

URLs appear in many forms, but typically you’ll see URLs like organized in this order:

  1. Protocol (generally http or https)
  2. Domain name
  3. Top Level Domain (TLD) (generally .com)
  4. URL path

If we look at the URL https://www.example.com/article, https is the protocol, example is the domain, .com is the TLD, and article is the URL path.

Those are the basics, but there’s still other aspects of URLs that are important to know.

URL Protocol

The URL protocol of URLs on websites are almost always http or https. http stands for HyperText Transfer Protocol, and is the default protocol for the world wide web. It’s a set of rules defining how files should be transferred. https stands for HyperText Transfer Protocol Secure, and as the name implies, is an update to http that makes connections more secure.

I’ll spare you the technical details, but the key thing to note is that https is a small ranking factor for SEO, and certain browsers like Google Chrome will display warnings to users when they are are non-https websites, particularly on shopping cart and checkout pages. If you haven’t yet made the switch to https, it’s definitely time.

www vs. non www

Many people often wonder what the difference between www and non www URLs are, and if one is better for SEO. The short answer? It doesn’t matter. Use whatever you prefer.

It’s a good idea to be consistent though, and setup a proper canonical tag pointing to the preferred version. Better yet, redirect the www or non www URLs to the preferred version at a sitewide level.

Domain Name

The domain name is the name of your website; for my site, it’s justinmckinney. Most businesses will name their domain after their business, but that isn’t required. You can technically buy whatever domain name you want, assuming it hasn’t already been taken. Reach out to your hosting provider if you’re looking to purchase a domain.

Top Level Domains (TLDs)

TLDs are the domains listed in the root zone of the URL, after the domain. The most common TLD is .com, but you can see a whole list of TLDs here. Other common TLDs include .edu and .gov.

Technically, .com, .edu, and .gov are gTLDs (general top level domains), but most people will refer to them as TLDs.

Country Code Top Level Domains (ccTLDs)

ccTLDs are a form of TLDs, but correspond to a specific country. My website uses the .us ccTLD. These are commonly used by websites that are catering to a specific country.

Subdomains

A subdomain is a separate domain built off of the primary (or root) domain that generally has a different function than the primary domain. For example, https://www.careers.example.com would be the homepage for the careers subdomain, built off of the primary example.com domain.

Subdomains are treated as separate websites by search engines, which is key to remember. That means that any SEO equity built to your primary domain has little to no impact on the SEO strength of your subdomain, and vice versa. For that reason, I generally don’t recommend using subdomains. That said, there are some instances where subdomains can be helpful, such as when the subdomain has a substantial amount of unique information on it, or when it’s purpose is very different than the primary domain but it doesn’t make sense to build out an entirely new website.

Subfolders and Subdirectories

Subfolders and subdirectories are interchangeable terms that refer to sections of the URL located after the TLD. As an example, the subfolder in https://www.example.com/recipes/muffin-recipe would be recipes.

Subfolders are used to help organize the content on your website, so that not everything lives entirely off of the root domain. This can be helpful for a number of reasons, such as:

  • Grouping related content together
  • Analyzing overall data from a particular section of the website
  • Consolidating SEO equity on a single domain

Subdomains vs Subfolders

Many people ask what the difference between subfolders and subdomains are, and when you should either. Google says either is fine, but like I said earlier, I recommend sticking with subfolders wherever possible to consolidate SEO equity.

Speaking of SEO equity, let’s now get into optimizing your URLs for SEO.

How to Optimize Your URLs for SEO

Use short URLs

Some studies have shown that there is a (weak) correlation between short URLs and higher keyword rankings. Short URLs are easier to understand by users and robots, and are easier to remember by humans. Google even explicitly recommends keeping your site’s URL structure as simple as possible. Stick with short URLs.

URLs have a maximum character limit of 2,083 characters in Internet Explorer, but will be truncated in the SERPs (search engine results page) if they’re longer than approximately 512 pixels. You should never even come close to worrying about your URL exceeding the character limit; if you have, something’s gone horribly wrong.

Use Keywords in URLs

Google has also said that using keywords in URLs and domains is a small ranking factor, and third party studies have showed that top-ranking websites for particular keywords often use said keywords in their URLs/domains.

Now, you obviously don’t want to overdo it; if your article is about muffin recipes, your URL doesn’t need to be muffins.com/muffins-are-the-best-here-are-great-muffin-recipes-for-muffin-lovers. Keyword spam doesn’t work for search engines, and it just looks spammy to real people.

Make URLs Human Readable

Speaking of real people, write URLs that are human readable (and more importantly, memorable). For example, if the URL of this article was some crazy string of numbers, it would be unclear what this article is about. Now if you were to share this link, it would be clear to other people what it is about.

One aspect of making URLs readable is using punctuation. /urlsseo is worse than urls-and-seo. Google recommends using hyphens, not underscores or spaces.

Something to definitely avoid is using session ids in your URLs. Not only do they make your URLs really ugly, it makes data analysis in Google Analytics a huge pain.

Don’t Use Unsafe Characters

Without getting too technical, there are certain characters you shouldn’t be using in your URLs. These are referred to as unsafe characters, and include the following:

” < > # % { } | \ ^ ~ [ ] ` space

If you’re interested in learning more, check out this resource.

Only Have 1 URL for Each Unique Page

This gets into a much bigger discussion about canonicalization, but it’s important that for each page on your site, there’s only one URL associated with it.

For example, if your URL is https://www.example.com/example, the following versions of this URL should redirect to and/or be canonicalized:

  • https://www.example.com/example/
  • http://example.com/example
  • https://example.com/example
  • http://www.example.com/example/

And so on and so forth.

Use Lowercase Characters in URLs

While you can technically use whatever casing you want for your URL characters…why would you? Everyone types in lowercase, so don’t overthink this one. It’s also a good idea to setup a redirect rule to redirect URLs with alternate casing (such as all uppercase URLs) to the lowercase version, but that’s a more advanced topic involving htaccess and regular expressions.

Be Careful with Dynamics URLs

Dynamic URLs are auto-generated URLs created by a website, usually when a query is sent to the database. A common example of a dynamic URL is when you use internal site search on an ecommerce website; the URL it sends you to is often dynamically generated based off of your specific search term.

Dynamic URLs aren’t necessarily bad, but they don’t follow the best practices laid out above. Nobody will ever remember a dynamic URL, and having dynamic URLs can lead to duplicate content issues.

If your website leverages dynamic URLs, it’s imperative that you use canonicals to avoid duplicate content issues.

Be VERY Careful with Google Search Parameters

One way of dealing with dynamic URLs is using the URL Parameter Tool in Google Search Console. As Google puts it;

You can use the URL Parameters tool to indicate the purpose of the parameters you use on your site to Google. For example, if you are the owner of a global shopping site, you might tell Google that you use the country parameter to distinguish between pages dedicated to consumers in different countries. Then you can set preferences for Google might crawl the URLs that contain those parameters. The preferences that you set can encourage Google to crawl the preferred version of your URL or simply prevent Google from crawling duplicate content on your site.

While the tool can be used to tell Google to not crawl and index certain URLs, it can also cause massive indexation problems if you don’t set it up right. Make sure you know what you’re doing before you use this tool.

Leave a Reply

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