What is a Slug & How to Optimize It
If you are new to SEO, you may have seen the term “slug” thrown around without seeing a good definition for it. In this article, we’ll cover everything you need to know about slugs, including what a slug is, why slugs are important, and how you can optimize them for your website. As you’ll see, optimizing your slugs is an easy and effective way to improve your website’s SEO.
What is a Slug?
The term ‘slug’ originated on WordPress and is used to describe the part of a URL that comes after the site domain. Slugs are used to differentiate each page on a website with a descriptive, to-the-point name that gives users and search engines an idea of the page’s contents.
Take a look at the following example:
http://www.exampledomain.com/what-is-a-slug.html
In the above URL, “exampledomain.com” is the domain name, and “what-is-a-slug” is the slug. Notice how, as soon as you see the slug, you have a rough idea of the contents of the page. That’s a sign of a good slug, though there are a few ways to optimize it even further.
Why Optimize Slugs?
Having well-optimized slugs is essential for two reasons: they make your URLs more attractive to users, and they can affect your page’s rankings.
Users use slugs to get an idea of a page’s contents before they click on its link. This is true no matter where the link appears — whether it was entered directly into the navigation bar, displayed on a SERP, or shared by a friend on social media. In all of these cases, you want users to look at the URL and be confident about clicking on it because it looks professional and seems like it will give them the information they are looking for.
Search engines look at slugs in a very similar way. Much like your page’s title and headers, search engines read slugs to get information on what a page is about. Having descriptive, well-optimized slugs can, therefore, have an impact on your ability to rank for your target keywords.
How to Optimize a Slug
Optimizing your website’s slugs is as simple as following six rules:
-
- Design your slugs with users in mind — Which would you feel more comfortable clicking on, a URL with a long string of gibberish after the domain name or a URL with the exact keywords you were looking for? Users and search engines look at slugs to get an idea of a page’s content before they click on it. You should, therefore, keep your slugs appropriately descriptive.
- Use keywords — Having a page’s target keyword as the URL slug is a great way to inform both users and search engines that the page is about that keyword. This will help your click-through rate as well as your rankings.
- Keep it short — The days of keyword stuffing are long gone. While you might be tempted to include as many keyword variations as you can fit into your slug, doing so makes your slugs less attractive to users and will likely hurt your rankings as well.
- Eliminate stop words — One of the best ways to keep your slugs short is to eliminate stop words. These are ubiquitous words such as a, the, what and various forms of the verb to be that convey little information and are primarily grammatical. Eliminating stop words is an easy way to make your slug punchier without sacrificing any descriptiveness. If we apply this rule to the example URL above, we get:
http://www.exampledomain.com/slug.html
Do you miss the stop words? Me neither. - Separate words with dashes — This one doesn’t require much explanation. Dashes make your URLs readable to search engines and users alike, and they are the only characters you should use between words.
- Use lowercase characters only — Some web servers, including Apache, which is used by WordPress and other CMSs, will interpret the same URL with variations in capitalization to be different URLs altogether (e.g., http://www.exampledomain.com/what-is-a-slug vs. http://www.exampledomain.com/What-is-a-Slug). For this reason, it is best practice to make all letters in your slugs lowercase.
How to Create Optimized Slugs on WordPress
WordPress makes it easy for you to optimize your slugs, but only if you have the correct settings.
Permalink Settings
The first thing you’ll want to do to make great slugs on WordPress is to change your permalink settings. Navigate to Settings, and then Permalinks. Once there, you want to select the ‘Post name’ option.
Selecting this setting will automatically create a slug for each of your new posts with the post name separated by dashes. This gives you a good starting point for making optimized slugs because your post title should already have your primary keyword in it. From there, you’ll need just a few edits to make a fully optimized slug!
Editing Slugs
With the ‘Post name’ permalink option enabled, optimizing your slugs is as simple as following the six rules listed above:
- Keep your users in mind
- Use your primary keywords
- Keep it short
- Eliminate stop words
- Separate words with dashes
- Use lowercase characters only
That’s all there is to it! Next, we’ll cover a couple of common slug mistakes that you’ll want to avoid.
Avoiding Common Slug Mistakes
Optimizing slugs is a relatively easy way to boost your site’s SEO, but there are some important pitfalls to keep in mind.
Make Your Slugs Count
Every page on your site must have a unique slug, which means that you can only use a slug one time. If you make and publish a post with the URL www.exampledomain.com/slug, then you should be confident that you won’t want or need to use that slug for another page in the future.
You might be asking yourself: Why couldn’t I just change the page’s slug after it is published to something else?
The answer is that you can, but it may cause you some headaches. You would need to then redirect the original URL to the new URL to avoid 404 issues or else manually change all your internal links to the new URL — though this still wouldn’t help you with any external links the page may have had.
Given these problems, it is important to have some forethought when making your slugs. Many SEOs optimize their slugs as one of the very last steps in the post-publishing process. This helps to ensure that the slug accurately reflects the finished product and won’t need to be changed at a later time.
Use Dates Selectively
If you are creating evergreen content that you want to stay relevant well into the future, then you will want to avoid putting dates in your slugs. You can change the date listed in a page’s title or the date at which it was last updated, but you will not be able to change the slug without running into the 404 issues mentioned above. This can make your page appear dated even if you have recently updated it.
Dates can be valuable additions to a slug if you are creating time-sensitive content, such as news. For most content, though, it’s better not to have a date.
Getting the Most Out of Slugs
If you’ve made it through this article, you now have a solid understanding of what a URL slug is and how to optimize it. A well-optimized slug is one of the fundamental tools in an SEO’s toolbelt, and you now have everything you need to get the most out of your slugs going forward.
For more tips, tricks and answers to frequently asked questions, check out our Knowledge Base. Or if you are interested in speaking with an inbound marketing expert, you can contact us today for a free quote.