Technical SEO

SEO: Creating the Perfect URL, or Not

The elements of a URL include <em>protocol, subdomain, domain, </em>and<em> top level domain</em>.

The elements of a URL include protocol, subdomain, domain, and top level domain.

URLs are what search engines use to aggregate all the data they collect regarding a page of content. For search engine optimization, what’s in a URL can be the difference between ranking number one and not ranking at all. Some of the things that matter and don’t, however, may surprise you.

Known formally as Uniform Resource Locators, URLs tell the requestors like servers and browsers where to find a page. They’re a human-readable format designed to mask the underlying number-based IP addresses. The diagram above illustrates the different pieces of a URL’s anatomy.

Friendly URLs contain words instead of long lists of numbers and letters. They are desirable because they are human readable, and for the small keyword relevance signal they send to search engines. The URLs that your platform creates automatically, by default, are probably not friendly. But most platforms these days have an option to make URLs friendly by substituting the names of paths and pages in the hierarchy of the site for the default numbers and letters.

Consider, for example, the following two URLs.

https://www.example.com/platform-id/products?catid=1262a89sd237g4df556ju&prodid=3489789

https://www.example.com/mens-shoes/loafers/brandx-jackson-penny-loafer-3489789

The second URL isn’t much shorter, but it is less intimidating and immediately recognizable as to what the shopper will get: a page related to men’s shoes.

Creating Optimal URLs

The best URLs for SEO have surprisingly few requirements.

  • Be as short as possible. Use as many characters as necessary to render a unique URL, but don’t insert extra words or folders into URLs purely for the benefit of SEO.
  • Use only lowercase alphanumeric characters. Uppercase characters are technically different characters than lowercase. Forcing all characters to the lowercase removes the potential that uppercase-URLs will crop up and generate duplicate content. Alphanumeric characters are important because any character that is not 123 or abc or one of the few allowed punctuation marks (such as ? and / ) will be encoded into confusing ASCII characters in your URL.

For example, the ® (registered trademark) symbol would be encoded to %AE in the URL, and a space in a URL would be encoded to %20. Even accented letters common in languages other than English will be encoded. For example, é will become %E9. For more information on URL encoding, see W3Schools.

  • Use hyphens as word separators. One of the few non-encoded marks, hyphens are the only traditionally recognized word separator. Underscores and spaces are not treated as separators and will be ignored, causing the words you intended to separate to be considered as a single long word by search engines.
  • Use keywords when possible.

Notice that “use keywords” is the last element in the SEO priority list for creating optimal URLs. Google engineer John Mueller has gone on record several times to say that “keywords in URLs are overrated for Google SEO.”

Yes, keywords are one more signal in the hundreds that contribute to better rankings. Yes, they’re important for human understanding and therefore user experience. But inserting keywords is not a good reason to rush out and optimize your URLs outside of a larger redesign or migration effort. Do it carefully and thoughtfully as part of a larger technical project that requires URL changes.

HTTPS Preference

Google prefers secure sites hosted on the HTTPS protocol, and has given them a ranking boost since 2014. The signal has strengthened since then, to the point that some studies show that over half of the search results on page one are now coming from sites on HTTPS.

The change from HTTP to HTTPS is technically a URL change, which does contain a certain amount of risk. Google in particular states that it is “pretty good” at handling the migration to the secure protocol. But 301 redirects should still be used to hasten the transition and performance needs to be monitored carefully to identify any potential issues.

Like optimizing URLs to contain keywords, migrating to HTTPS should be done cautiously. The IT team will have to take a lot of steps that SEOs don’t typically consider, such as moving all of the resources that make up the page — images, JavaScript files — to HTTPs as well as the primary site content.

That content may be hosted in different environments, all of which will require different security certificates. While load speed isn’t something that plagues most modern HTTPS implementations, it should be checked as well since it is also a ranking factor in search results. Canonicals, redirects, robots.txt files, XML sitemaps, webmaster tools’ verification, and other tasks will also need to be handled as part of the move.

For more on migrating to HTTPS, see “SEO: How to Migrate an Ecommerce Site to HTTPS.”

Hashtags in URLs

SEO professionals usually either proclaim JavaScript universally bad or universally crawlable based on whether or not they believe Google’s proclamation that “we are generally able to render and understand your web pages like modern browsers.”

However, there’s a big difference between everyday forms of JavaScript (some of which have been determined to be successfully crawlable and some not) and AJAX — “Asynchronous JavaScript and XML.” AJAX is characterized by a URL that does not change as the content within the browser changes. AJAX also forces hashtags in a URL, typically.

Why include AJAX stuff in an article about URLs? Because hashtags in URLs are bad for SEO.

Google's John Mueller on Hashtags

Google engineer John Mueller on Twitter explaining that hashtags prohibit indexation.

Optimally crawlable content is characterized by the mantra of one URL for one page of content. AJAX creates one URL for many pages of content, essentially robbing the search engines of a unique page label to which they can tie relevance and authority signals.

This article can’t go into the full story behind AJAX and hashtags in URLs, but if your developers want more information, tell them to look into pushState, which Bing and Google both support. Progressive enhancement and feature detection are always search engine favorites when it comes to site development, as well.

Note that the escaped fragments standard that Google developed in 2009, characterized by #! in URLs (“hash-bang” is the only time a hashtag is grudgingly accepted in a URL), is still supported, but it hasn’t been recommended by the engines since 2015.

When to Optimize URLs

Platform migrations and redesigns are the ideal times to optimize URLs. They’ll likely need to change as the site structure or technology changes anyway, so it’s a good time to insert requirements around URL content and syntax.

Importantly, only optimize your URLs if it’s required for technical reasons or as part of a larger platform migration or redesign effort. There’s too much risk and not enough reward in optimizing URLs — even to switch from parameter-based URLs to keyword-rich friendly URLs — to do it for the sake of SEO benefit.

Think of it this way: URLs are important to SEO because search engines attach their measurements of value to them. When a URL changes, the relevance and authority signals that search engines attach to a page are lost.

When you must change URLs, always 301 redirect the old URL to the new one. Redirects harvest the relevance and authority signals that the old page has earned over its lifetime and transfer the signals to the new page. The 301 redirect also prompts search engines to stop indexing the old URL and begin indexing the new one. For more information on 301 redirects and SEO, read my article “For Redesigns, Protect SEO with 301 Redirect Strategy.”

Jill Kocher Brown
Jill Kocher Brown
Bio   •   RSS Feed


x