How to write URLs properly and add value to your site

Andy Warhol point to a Gallery of URLs
January 21, 2020

Jo Fraser




Even after years in the industry, content creators are still getting one little thing wrong. And no, it’s not how to use a semicolon.

Need a clue? Look at the top of your screen.

For content creators, the humble URL is often an after-thought or not a thought at all. But used correctly, it can be one of the most important tools in your arsenal. Nail the fundamentals of URL creation, and put them into practice daily to improve your SEO. Get it wrong and pay for it with broken links and crawl errors, resulting in poor SEO and the ongoing and frustrating task of fixing them all. When Google’s Spider (their crawl algorithm) reaches a broken link, it’s similar to hitting a dead end. A broken link is all it takes for Google Spiders to stop the indexing process, which can ruin your chances to get a higher rank in Google.

Customers are also losers when it comes to bad URL practices; I’m sure we’ve all fallen victim to an annoying 404 page or dead internal link. Not only is this a negative customer experience, it damages a brand’s credibility and trustworthiness in the long-term. Unsurprisingly, broken links lead to higher bounce rates, raising a big red flag to search engines that there is something wrong with the page.

URL fundamentals: How to avoid broken links

By using validations and implementing restrictive rules, you can avoid all of these negative consequences. Here’s what you need to know:

Follow a standard URL structure

URLs should be easily legible to humans. They’re not just for site navigation, but also lend clues to the user about where they are and what they are looking at. URLs are partially created in your websites code, so the process of creating them should be a collaboration between you and your developers. It’s important to be involved in this process because there is a good chance you will have a say in how your content is structured.

Consider organizing your content so that URLs are constructed logically. It helps to think through your categories and subcategories and how to display them in your URL. Your URLs should mimic the way your content is organized. For example your category might be shoes: https://contentful/shoes/ and your subcategory might be green shoes: https://contentful/shoes/green/.

You will want to stick to the main categories –– it’s possible to get carried away and create a URL structure that you might understand, but your fellow content creators balk at. For example, if you’re searching for information about shoes, a URL like will help you know you’re in the right place.

Crawlers (think: Google Spider) like things simple. URLs with multiple parameters will confuse crawlers with the high number of URLs pointing to identical or similar content on your site. Your site content might not get indexed.

And don’t even think about settling for gibberish. A URL like will only confuse (and perhaps scare) you. Gibberish URLs are a huge missed opportunity when it comes to SEO and they make people feel nervous. Give your customers the peace of mind with a URL that speaks directly to them.

Use hyphens and underscores in your URLs to make them more readable. Hyphens are a great way to denote spaces in your URL. For example, try They are great replacements for stop words like “and”, “the” and “a”.

A good rule of thumb is that the easier a URL is to read for humans, the better it is for search engines.

A good place for a keyword

While packing your URLs with keywords used to be the height of SEO brilliance, Google now looks at your site’s content to know what you’re all about (and how you should rank) instead. It’s still a good idea to put your primary keyword in the URL, but now it’s mostly for your audience.

Trailing slash or no trailing slash

The trailing slash (/) seems to be as contentious as pineapple on pizza for most internet folks. The trailing slash initially indicated the difference between a directory and a file. A URL with a trailing slash would be a directory, and a URL without the slash would denote a file. (with trailing slash, conventionally a directory) (without trailing slash, conventionally a file)

Now, Google treats each URL separately and equally. These example URLs would send you to two different web pages.

This would be a really confusing experience for your user if this was the case. Imagine if and sent you to two different places. It would be a terrible user experience and would feel a little like navigating a map with two cities that had the same name. These two configurations should have the same content –– and for Google’s sake, one should redirect to the other.

In the trailing slash debate, there is only one winner: consistency. As long as you keep your use of the slash consistent, both in internal and external links, that is the best approach. There is no need to change your use of trailing slashes from one version to another for SEO purposes. If you’re starting a web project from scratch, the trailing slash is the way to go; it’s more commonly used.

Using validations to check for broken links

One of the best ways to fix broken links and the SEO havoc they cause is to use a broken link checker. We’ve created a UI extension that is readily downloadable from the marketplace that tests all included URLs in your entry by making actual requests to see if the URL responds with a 200 code.
The UI extension, once installed by your developer team, sits in your sidebar and with one click before publishing, you can validate all of your URLs.

See the UI extension in the marketplace.

For an in-depth walkthrough on optimizing SEO with Contentful, please refer to this guide.

About the author

Don't miss the latest

Get updates in your inbox
Discover new insights from the Contentful developer community each month.
add-circle arrow-right remove style-two-pin-marker subtract-circle remove