How to Create SEO-Friendly URLs (Step-by-Step)

How to Create SEO-Friendly URLs (Step-by-Step)

Joshua Hardwick
Head of Content @ Ahrefs (or, in plain English, I'm the guy responsible for ensuring that every blog post we publish is EPIC).
Article Performance
  • Organic traffic
    419
  • Linking websites
    274

The number of websites linking to this post.

This post's estimated monthly organic search traffic.

    Google talks about the importance of using simple, friendly URLs in their SEO starter guide, but how do you do that?

    Let’s start with the good news: creating URLs for SEO isn’t rocket science.

    If you were to describe your page in a few words and replace the spaces with hyphens, that would usually be “good enough” for SEO.

    But you’d probably prefer not to take a stab in the dark. So, below, we’ll run through a simple process for creating optimized URL slugs and a few best practices for the rest of the URL.

    But first, let’s make sure we understand how URLs are constructed.

    URLs consist of many parts.

    the anatomy of a url 4

    For SEO, the most important part is arguably the slug. You have to choose one of these every time you create a page or post.

    So let’s start there, and then we’ll cover a few SEO best practices for the rest of the URL.

    There’s rarely much point changing existing URL slugs as it takes too much time. You’re also likely to do more harm than good.

    So let’s focus on new posts and pages.

    If you did keyword research and created content around that keyword, jump to step 6.

    If you created your page without doing keyword research (which is never a good idea if you want to rank), follow the steps in order.

    1. Start with your page title
    2. Remove special characters
    3. Remove numbers
    4. Remove superfluous information
    5. Boil it down to a keyword
    6. Add keyword modifiers (optional)
    7. Make it readable (optional)
    8. Make it lowercase
    9. Replace spaces with hyphens

    1. Start with your page title

    Most page titles make perfectly optimized URLs with a bit of modification. So let’s start here and run through a series of steps to get the best possible URL slug for SEO.

    For the purposes of this article, we’ll use one of our own articles titled:

    How to Craft the Perfect SEO Title Tag (Our 4-Step Process)

    2. Remove special characters

    Have you ever seen a URL with backslashes () or square brackets ([])?

    Probably not, because these are unsafe characters that don’t belong in URLs.

    You should remove these for obvious reasons, but it’s also best practice to remove other special characters like commas, colons, semicolons, etc.

    Here’s what Google’s John Mueller says about these:

    I generally recommend avoiding special characters like commas, semicolons, colons, spaces, quotes etc. in URLs, to help keep things simple. URLs like that are often harder to automatically link (when someone posts in a forum or elsewhere), and hard for us to recognise correctly when we parse text content to try to find new URLs.

    So let’s remove all characters not in the alphabet—although we’ll keep the spaces in for now.

    How to Craft the Perfect SEO Title Tag Our 4 Step Process

    3. Remove numbers

    You’ll notice that our post is a four-step process and that this number is in the title.

    This is completely fine because a title is easily changed. If we update the post one day and add a fifth step, we can easily change the title of the page.

    title change 2

    It’s a different ball game with URLs.

    You’ll have to redirect to a new URL whenever you change the number of items in the page or post to keep it current.

    Redirecting a page or post usually isn’t a huge deal. WordPress does it automatically when you change the slug. However, it’s easy to forget to update the URL number when you update things, which leads to this kind of issue in the search results:

    2 incongruent title url 2

    A better solution is to negate numbers in the URL altogether. That way, you won’t have to update the URL when you make minor changes to the page.

    So let’s remove the number from our potential URL:

    How to Craft the Perfect SEO Title Tag Our Process

    4. Remove superfluous information

    Google says it’s good practice to make URLs as simple as possible, and there are likely a couple of reasons for that.

    First, visitors may be intimidated by extremely long URLs.

    Second, long URLs often get truncated in the search results.

    3 url truncation 2

    So let’s remove anything we don’t need from our potential URL.

    Note that you’ll have to use common sense for this part. The aim isn’t to make your URL so short that it no longer accurately describes its content. It’s to remove unnecessary words and phrases.

    In our case, this is probably just everything that was in the brackets (“our [4-step] process”)

    How to Craft the Perfect SEO Title Tag

    5. Boil it down to a keyword

    Most titles naturally contain keywords, so what you’re probably left with at this stage is a simplified, keyword-rich version of your title.

    While this might make perfect sense to use (and feel free to do so if that’s the case), it often won’t be very succinct.

    As we already discussed, this can lead to long URLs that get truncated in search results. The additional context can also be an issue should you ever want to update the page.

    For example, we had a post with the slug /basic-guide-anchor-text/. When we updated this post, we added a lot of information. This made the guide not-so-basic, and we had to redirect it to a more appropriate slug.

    4 anchor text post 2

    So, the next step is to find the keyword that represents the most popular way people search for your page’s topic.

    To do this, install and activate Ahrefs’ SEO toolbar, then Google your potential URL. Look for a similar page to yours in the results that also gets a decent amount of organic traffic.

    5 top ranking pages traffic 2

    IMPORTANT

    If the pages in the search results aren’t getting traffic, your page is likely about a topic with no search traffic potential. Because nobody is searching for what your page is about, it’ll be hard to get organic traffic—regardless of how well you optimize the URL.

    Avoid this mistake in the future by doing keyword research beforehand.

    Hit the “KW” link to see what keywords the page ranks for in Ahrefs’ Site Explorer.

    6 title tags post traffic 2

    Look down the list for the most relevant keyword that matches your content.

    7 organic keywords report 2

    If we were doing this for our post about title tags, it would probably be:

    title tag

    6. Add keyword modifiers (optional)

    Using an exact-match keyword for your URL slug often makes sense, but not always. Sometimes you’ll find that it lacks descriptiveness.

    A simple way to solve this is to add keyword modifiers.

    Keyword modifiers are related words that add context to your URL. You can find them in the Organic Keywords report that we used in the previous step.

    For example, if we look at the report for our competing page about title tags, we see “seo” and “html” pop up a few times.

    8 seo html modifiers 2

    It would make sense to include one or both of these in our URL.

    There are no hard and fast rules to the way you do this. It’s a case of using common sense. For example, any of these URLs would work for our post:

    SEO title tag
    HTML title tag
    title tag SEO
    HTML title tag SEO

    Just don’t stuff keywords like this:

    HTML meta title tag SEO

    Here’s the one I chose for our post:

    title tag SEO

    7. Make it readable (optional)

    Maybe it’s just me, but some URLs just seem more digestible than others.

    Take the ideas above. I would argue that /seo-title-tag/ makes more sense than /html-title-tag-seo/. Why? I think it’s because the former makes sense when used in a sentence, whereas the latter is just a random string of words.

    So, I often try to make URLs readable by adding conjunctions or pluralizing.

    For our post about title tags, I didn’t do this because “title tag seo” seemed to read perfectly fine.

    However, for our post about the best WordPress plugins for SEO, the most fitting keyword was “best seo plugin wordpress.”

    9 best seo plugin wordpress organic keywords 2

    That sounded odd, so I pluralized “plugin” and added the conjunction “for.”

    9 best seo plugin wordpress 2

    As you can see, the URL is still short and sweet but reads a lot more naturally.

    8. Make it lowercase

    Most web servers treat lower and uppercase URLs the same, but this isn’t always the case. Technically, everything after the hostname (domain) in a URL is case-sensitive, and some servers will treat them differently.

    To be on the safe side and to avoid potential duplicate content issues, use lowercase URLs—always.

    If you’re using WordPress, you can skip this part because it happens automatically.

    wordpress slug lowercase 2

    If not, just to paste your title into convertcase.net and choose lowercase.

    title tag seo

    9. Replace spaces with hyphens

    URLs can’t include spaces. Browsers rewrite them to “%20”.

    Screen Recording 2020 05 14 at 08.08 pm 2

    So, the final step is to replace all of the spaces with hyphens (-).

    Can you use underscores (_) instead? Google said in 2016 that they don’t care if your URLs contain dashes or hyphens. That remains true from a ranking perspective, but as people are generally more familiar with hyphens, it makes sense to use them where possible.

    It’s also Google’s official recommendation:

    We recommend that you use hyphens (-) instead of underscores (_) in your URLs.

    Here’s the final slug for our post about title tags:

    title-tag-seo

    Earlier in this guide, we talked about the anatomy of a URL.

    the anatomy of a url 5

    The process above only tackles one part: the slug.

    So here are some SEO best practices to keep in mind for the rest of the URL.

    Use HTTPS

    HTTPS encrypts data sent between site visitors and your web server. It’s been a lightweight ranking factor since 2014.

    So if you’re not yet using HTTPS, it’s definitely worth switching.

    Recommended reading: What is HTTPS? Everything You Need to Know

    Use subdomains only if you need to

    Subdomains appear before the domain name. They’re typically used to separate different areas of a website according to their functionality.

    For example, Hubspot’s blog is on a subdomain.

    10 hubspot blog subdomain 2

    Google says that they treat content on subdomains the same as any other content and that it’s no harder to rank a subdomain than a subfolder.

    https://www.youtube.com/watch?v=uJGDyAN9g-g

    However, many SEOs disagree, and there have been many reported cases of traffic increases after moving content from a subdomain to a subfolder.

    Nobody knows for sure why this is, but the common theory amongst SEOs is that Google sometimes treats subdomains as separate websites.

    So our advice is not to use subdomains unless absolutely necessary.

    Choose a memorable domain

    If you’re still in the early stages of your website and haven’t chosen a domain yet, don’t worry about getting a keyword-rich or exact-match domain. Just go for something that’s memorable and brandable.

    Here’s what Google’s John Mueller said about keyword-rich domains:

    …just because keywords are in a domain name doesn’t mean that it’ll automatically rank for those keywords. And that’s something that’s been the case for a really, really long time.

    Choose an appropriate TLD

    If you want to attract global traffic, choose a generic top-level domain (gTLD) such as .com.

    Google treats all gTLDs the same from an SEO standpoint, but .com is usually the best if you can get it. TLDs like .biz, .info, and .name are often associated with spam, so choosing one of those might affect your ability to build high-quality links.

    If you’re targeting customers in a specific location, use either a gTLD or country-code top-level domain (ccTLD) such as .co.uk or .fr.

    Sidenote.
    It’s perfectly fine to use a gTLD like .com when targeting customers in a specific location too. 

    Use subfolders to provide hierarchy

    Subfolders help provide a sense of hierarchy and give useful extra information.

    For example, take this URL:

    domain.com/airpods.html

    It’s unclear from the URL whether the page is selling AirPods, an AirPods review, or something else.

    Now look at this:

    domain.com/store/earbuds/apple/airpods.html

    This is clearly the URL for a product page selling AirPods.

    But that’s not all the subfolder structure tells you. It also makes it clear that:

    • Earbuds are just one of the types of products on offer from the online store.
    • Apple makes this product, and there are potentially other earbuds for sale from this same brand.
    • There are likely other brands of earbuds for sale in the store.

    Using subfolders also makes it easier to incorporate keywords into URLs without them looking spammy.

    Spammy: domain.com/buy-apple-airpods-earbuds.html
    Non-spammy: domain.com/store/earbuds/apple/airpods.html

    Use as many subfolders as you need

    Many SEOs believe that having too many subfolders in a URL hurts rankings. However, Google has stated on numerous occasions that this isn’t true.

    That said, because of how most modern CMS’ work, having lots of subfolders in a URL is often a sign that a page is “buried” in the site architecture.

    That isn’t ideal if you want users (and search engines) to be able to find the page.

    If you suspect this might be a problem on your site, don’t rely on the number of subfolders for proof. Instead, crawl your site with a tool like Ahrefs’ Site Audit and look for deep pages.

    You can use this set of filters in the Page Explorer the do that:

    Page Explorer in Ahrefs’ Site Audit.

    Avoid keyword repetition

    Repeating keywords in URLs makes them look spammy.

    It’s often easy to avoid this when creating URL slugs, but it’s an easy mistake to make when working with subfolders.

    For example, take a look at the URL for this page:

    myer.com.au/c/men/mens-shoes/mens-sneakers

    It repeats the word “men” three times.

    While this isn’t a huge deal, the repetition is unnecessary. This would probably be better:

    myer.com.au/c/men/shoes/sneakers

    Avoid dates

    Most popular CMS’ (e.g., WordPress) use URLs with dates by default—at least for posts.

    This can cause issues if you ever update your content because Google may end up showing contradictory information in the search results.

    12 date in url 2

    Now, if your site is set up like this and you’ve already published content, don’t change things. The risk of breaking your website is too high.

    However, if you’re setting up a new site using WordPress, the simple solution to this issue is to change your permalink settings before publishing anything.

    13 wordpress permalinks 2

    Avoid URL parameters where possible

    URL parameters usually appear after a question mark (?) in the URL.

    These are common on ecommerce sites with faceted navigation and sorting options, but it’s best to avoid them on indexable pages unless absolutely necessary.

    Why? Because they can cause duplicate content issues. That’s where the same or similar content is accessible at multiple URLs.

    On an ecommerce site, this might be the same product in different colors or styles.

    For example, look at how the URL changes here while the page content stays the same:

    Screen Recording 2020 05 14 at 08.28 pm 2

    If this happens on your site, make sure to canonicalize similar or duplicate URLs to the version that should rank in search engines.

    You can find duplicate content issues on your site in the Duplicate content report in Ahrefs’ Site Audit.

    14 duplicate pages site audit 2

    Final thoughts

    While it doesn’t pay to spend too much time creating SEO-friendly URLs, it certainly makes sense to take a logical approach to them and follow best practices.

    Plus, the process above will take seconds or minutes once you’ve done it a few times.

    Got questions? Ping me on Twitter.

    Article Performance
    • Organic traffic
      419
    • Linking websites
      274

    The number of websites linking to this post.

    This post's estimated monthly organic search traffic.