What Is a URL Slug?
A URL slug is the last part of a URL address that serves as a unique identifier of the page.
For example, the article you’re reading now has a URL that looks like this:
https://semrush.com/blog/what-is-a-url-slug/
Its URL slug is “what-is-a-url-slug.”
Why Is a URL Slug Important for SEO?
A URL slug is often considered a great place to include the target (or primary) keyword for a page.
Google’s John Mueller has confirmed that words in a URL are a ranking factor.
But he also emphasized that it’s a “very very lightweight” one, and it primarily helps to assess the page before Google accesses it.
In one of his tweets, Mueller said:
In other words:
Even if having keywords in the URL is a ranking factor, we shouldn’t overestimate its effect on rankings.
However, it might still make sense to use the target keyword of a page in a URL slug. Especially considering the user experience (UX) point of view, which is closely connected to SEO.
Let’s take a look at these two examples:
- https://website.com/blog/rock-climbing
- https://website.com/blog/82354
While the first example provides clear information about the content of the post, the second is just a chain of numbers that doesn’t provide any added value.
If someone only saw these two URL addresses, they’d be more likely to click the first one. Regardless of the actual content on either page.
That’s why a URL slug should provide a concise description of a page.
URL Slug Best Practices
Let’s take a look at some best practices and tips on how to create good URL slugs.
Be Descriptive
As we’ve already mentioned, the primary role of URL slugs is to make URLs more user-friendly. Therefore, they should describe the content of a page.
- Good URL slug: /best-air-purifier
- Bad URL slug: /2575
Using the target keyword is a great way to achieve this. Why? Because it’s usually an accurate, yet very short, description of what the page is about.
Make It Concise and Easy to Read
A good URL slug shouldn’t be too long. Long URLs are harder to read and remember. Try to use fewer than five words in your slug.
- Good URL slug: /abs-exercises
- Bad URL slug: /the-best-abs-exercises-for-all-levels-of-gym-goer
Also, a URL that’s too long will get truncated in Google’s search results. While this is not an SEO disaster, it doesn’t make the page snippet look very good.
Include Your Target Keyword
Including your target keyword in the URL slug will make it easier for both search engines and users to understand that your page is relevant to a particular search query.
Here’s an example of a good and bad URL slug for a page targeting the keyword “keyword research.”
- Good URL slug: /keyword-research
- Bad URL slug: /10-tips-for-researching-keywords
Separate Words
How you separate the words (or not) influences the readability of a URL slug. Separating the words in the slug helps users understand the URL more easily.
- Good URL slug: /best-travel-tips
- Bad URL slug: /besttraveltips
Use Hyphens, Not Underscores
The best practice is to use hyphens to separate words in URLs. Search engines may not correctly interpret other separators (like underscores).
- Good URL slug: /good-old-fashioned-pancakes
- Bad URL slug: /good_old_fashioned_pancakes
Use Lowercase Characters
Since URLs are case-sensitive, it’s best to stick to lowercase characters to avoid mistyped URLs.
Lowercase URLs are also easier to type manually.
- Good URL slug: /new-york
- Bad URL slug: /New-York
Avoid Special Characters
Google Search Central recommends avoiding non-ASCII (American Standard Code for Information Interchange) characters, such as special characters of some languages or emojis.
Here’s an example for a hypothetical page in German:
- Good URL slug: /kaiserstrasse
- Bad URL slug: /kaiserstraße
And one using emojis:
- Good URL slug: /emoji-meanings
- Bad URL slug: /😊🚀
Make It Future-Proof
It’s best to avoid numbers in URLs that are likely to be changed in the future, like a number of tips or ideas or the publishing year.
- Good URL slug: /how-to-write-url-slugs
- Bad URL slug: /10-tips-to-write-url-slugs-in-2022
URL Slugs in WordPress
Let’s take a closer look at how to change a URL slug in WordPress.
First and foremost, you need to make sure your permalink structure will allow for user-friendly URL slugs.
Go to “Settings” and click “Permalinks.”
Here, you’ll be able to select one of the basic permalink structure types or create a custom one. We recommend using the “Post name” structure.
This way, WordPress will automatically create URL slugs based on the title of your page or post. But more importantly, it will allow you to edit the URL slug.
To change a URL slug in WordPress, go to the editor of a specific post or page.
Here, in the right panel, you’ll find the “Link” section. After clicking the automatically generated slug, you’ll be able to edit it.
If you’re using the Yoast SEO plugin, you can change the URL slug in the Yoast SEO panel at the bottom of the post editor.
The plugin’s “SEO analysis” section will also notify you if your URL slug does not contain your focus keyphrase (i.e., the target keyword).
Take this as a recommendation you can follow if it makes sense for you—not something you need to do at all costs.
As we’ve established earlier, keywords in URL slugs have a very small SEO impact. You should primarily focus on the user experience rather than keyword stuffing.
Check Your Website for URL Issues
You can use Semrush’s Site Audit tool to check your website for a number of URL issues that might be preventing you from getting higher rankings in search engine results.
Here’s how:
Enter your domain and click the “Start Audit” button.
Site Audit lets you customize a number of settings for the audit. In most cases, you can simply stick to the default settings and click “Start Site Audit” to start the audit.
The tool will then analyze your website for a variety of technical SEO issues. And present you with a detailed report outlining all the issues.
From here, navigate to the “Issues” tab and type “URL” in the search bar.
You’ll then see a list of all URL-related issues the tool uncovered on your website.
A few common issues you might encounter include:
- Incorrect URL format: Using special characters or spaces which search engine crawlers can’t process
- URLs with too many parameters: Using too many URL parameters (e.g., /?color=black) makes URLs less enticing for users to click and can lead to duplicate content issues
- URLs that are too long: URLs with over 200 characters can appear truncated in Google’s search results, making users less inclined to visit them
You can then click on the linked part of each issue to see a list of pages affected by it. Or click on “Why and how to fix it” to find out more about the issue and how to address it.
Optimize Your URL Slugs
URL slugs are a small but important part of optimizing a page for search engines. Follow the tips outlined above to make sure your URL slugs are SEO-friendly.
And use Semrush’s Site Audit tool to check your website for URL-related issues.
FAQs About URL Slugs
Does the URL Slug Affect SEO?
Yes. As confirmed by Google’s John Mueller, URL slugs are a lightweight ranking factor.
Google’s crawler looks at a website slug to get a better understanding of what the page is about before crawling it.
Are Website Slugs Important for SEO?
Yes, URL slugs are important for SEO. They are an important user experience element. And UX and SEO are closely connected.
However, words used in URLs are a very lightweight ranking factor.
What Is the Difference Between a URL Slug and a URL?
The URL is the entire web address of a page, while the URL slug is just the last part of the URL that serves as an identifier of the page.
- URL: https://www.apple.com/shop/iphone-12
- URLslug: /iphone-12
What Happens When You Change the URL Slug?
Once the URL slug is changed, the whole URL address of a page is changed. It means the page can’t be accessed through the old URL address anymore.
Every time you change the URL slug, it is best practice to set up a 301 redirect from the old URL to the new one.
This way, you’ll prevent users from landing on a 404 error page. As well as a potential loss of traffic and link equity from links pointing to the old URL.
Why Is It Called a Slug?
The name “slug” has been used in journalism. It refers to the practice of using short descriptions of articles for internal purposes.
Web developers supposedly picked up on this terminology and started using it to refer to the descriptive part of the URL.
Source link : Semrush.com