WHAT IS A URL SLUG?
Let’s answer that question right away…
The slug is the last section of a URL (Uniform Resource Locator). And for those who don’t know, a URL is the address of a unique page on the internet. It’s what you see in the address bar of your browser. For example, the URL for this page is ‘https://webpi.co/optimise-url-slugs/‘ and the slug is ‘optimise-url-slugs/’.
WHY ARE URL SLUGS IMPORTANT?
There are two main reasons that URL slugs are important.
- For SEO. Search engines use the words that are in your slug to help determine what the page is about. It’s imperative that you include your key phrase within your URL slug to get the most SEO benefit.
- For users. The URL is listed just above the article title in Google Results. It is a key piece of information that helps the user decide if this is the article for them. If your slug is concise and readable, there is a much higher chance you’ll get that click.
BEST PRACTICES TO OPTIMISE YOUR URL SLUGS
- Use lowercase letters only. This is an excellent tip for stylistic reasons – a completely lower case URL looks better. It also may help to avoid missing or duplicate page issues.
- Avoid special characters. Keep things simple. Avoiding special characters like commas, semicolons, quotes, etc., aids usability and makes URLs easier to type.
- Avoid numbers and dates. Numbers and dates add no value. And in fact, if you update your article at a later date, they may prove to be a hindrance. Imagine you wrote an article called ‘7 best tips for URL slugs’ and used the slug ‘7-best-tips-for-url-slugs’. Then the following year you thought up two more tips and updated the article to ‘9 best tips for URL slugs’. If you update the URL slug to match, it will effectively be a new page in Google’s eyes and lose all the search ranking it had built up. Avoid numbers and dates in URL slugs.
- Remove stop words. Stop words are incidental words like ‘and’, ‘how’, ‘it’, etc. They don’t provide any value in this context. For example, the title for this page is ‘How to optimise URL slugs’. By removing stop words, I came up with the slug ‘optimise-url-slugs/’.
- Include relevant keywords. The slug is a key component of search engine ranking. Ensure you include your keywords within the URL slug.
- Don’t keyword stuff. Adding one relevant keyword is fine, but stuffing your slug with excessive keywords is both bad for your users and your Google ranking. Black Hat tactics like this stopped working a long time ago.
- Make it user-friendly. Keep your user in mind. Does the slug make sense to read? Would adding a stop word or two make it clearer and therefore more likely to be clicked? This is a judgement call, and there is no right answer.
- Separate words with hyphens not spaces. The issue with spaces is that browsers encode them to “%20” which makes future reading of the URL difficult. This helps keep your URL slugs simple and readable.
- Don’t use slugs that already belong to other pages. Your URL must be unique to avoid duplicate content issues. Ensure your slug is unique to that single page by making it specific and accurate.
- Make the slug similar to your title. This is good for search engines and for your users. If your title is ‘How to optimise URL slugs’ and your URL slug is ‘top-tips-for-tennis-forehand’ – Well, that’s just confusing for everyone. If you need guidance on writing titles, check out my article on how to write compelling website copy.
- Your URL slugs should be evergreen. Ensure that your URL slugs will stand the test of time by avoiding dates, numbers and anything else that might stop them being eternally relevant.
HOW TO EDIT URL SLUGS IN WORDPRESS
Firstly, ensure your permalinks are set up correctly by going to the Admin screen then Settings -> Permalinks. I strongly recommend using the ‘Post Name’ setting to ensure the best SEO results.
When you create a new post and write in the title, WordPress will automatically generate a URL slug for you. You can edit this on the right-hand side of the screen in the ‘Post’ settings section. If you can’t see the settings panel, then click the gear icon in the toolbar (top, right). From there, scroll down to the ‘Permalink’ section and alter your URL slug following the best practices in this article. Don’t forget to hit ‘Update’!
Once you’ve decided on your URL slug it’s important NOT to change it. This could cause missing page errors on your site. If you must change the URL slug then ensure you set up a 301 redirect.
SUMMING UP SLUGS
Who would have thought that such a tiny piece of the website jigsaw could be so complex? In truth, once you’ve optimised a couple of URL slugs, the best practices are quite easy to follow. If, however, you need any help with this or anything else WordPress website related, then please get in touch.