What is a slug in WordPress or how to change them for your blog posts and pages is an important concept to master and this is what we are going to discuss in this beginners tutorial.
Let’s dive in if you have never heard of WordPress slugs before.
Here are the topics we will discuss:
- WordPress Slug Meaning
- Difference between Slug and Permalink
- Changing WordPress Slug
- Optimizing Slug
- Slug Common Errors
What is Slug in WordPress
WordPress slug meaning is actually the user-friendly URL of your post specifically comes after your blog permalink structure. It usually remains same as your page or post title, consists of all small letters and replacing spaces with hyphens (-).
Here is a slug example to make things more clear:
Post Title: WordPress Slug Tutorial
Post Slug: wordpress-slug-tutorial
Difference between Slug and Permalink
Permalink is the complete URL of your page or post (including slug) which you share on social media and other networks.
While writing a new post, WordPress automatically generates a slug based on the current post title, however, permalink structure can’t be changed from within a post. It has to be set from WordPress > Settings > Permalinks.
To learn more about permalinks, visit our Easy Guide to WordPress Permalink Settings.
How to change WordPress Slug?
Changing or editing a WordPress slug is an absolutely critical job especially for the posts with long titles. Later in this tutorial, we will see optimization tips to make slugs cool and functional at the same time but for now, let’s see how to edit or change a slug in WordPress.
- On your post page, type your post title and click outside the title text box.
- Let WordPress generates the slug automatically based on what you have written in the post title. It will be shown as your post permalink.
- Click the Edit button next to Permalink.
- Type your new slug and press OK.
You have just changed your old slug. Don’t forget to publish your post to see it working.
Having said that, now let’s see some good practices for writing slugs for your WordPress posts.
Optimizing WordPress Slug
Keep your slugs shorter as much as possible. It is more important when you write posts with very long titles. A short slug length results in a shorter permalink which is easy to remember and share. It is also good for SEO according to Brian Dean SEO guide (No. 46).
Post Title: Mastering WordPress slug [Beginners Tutorial]
Post Slug(optimized): wordpress-slug-tutorial
Don’t sacrifice important keywords in making slug length shorter.Woopoo's Tip
Remove Stop Letters and Words
Stop letters and words are the common alphabets to write a post tile. For example, in a post title like How to write a post slug in WordPress? to, a and in are stop words and needs to be removed from your post slug. They don’t have any SEO value and the valuable space can be given to more meaningful words.
Post Title: How to write a post slug in WordPress?
Post Slug(optimized): writing-wordpress-post-slug
Your post should have a main keyword around which you are writing your article and use that same keyword in your post slug as well for better SEO. When Google bots visit your page, the first thing they will hook on will be your post permalink so give them a good idea right from the beginning by using your main keyword in the slug.
Changing Slug for Published Articles
Changing slug for your previous or published articles is not recommended as it will break all the external links which you or others have shared on social media and other websites. Clicking those links will show a Page Not Found error.
Changing slugs for already published articles in not recommended.Woopoo's Caution
It’s better to start this practice for your upcoming posts but if you really can’t live without changing your post slugs then the solution is to redirect traffic to your new permalinks.
There are many ways to do it in WordPress, see our guide Easy 301 Redirection in WordPress for more details.
Slug Common Errors
WordPress Slug adds 2
It is a common error that WordPress keeps adding 2 to the slug. You know WordPress generates slugs automatically but if a generated slug is already in use by another post then WordPress is intelligent enough to append a digit 2 to avoid any conflicts.
The solution is to simply change your post title or edit your post slug.
- Absolutely IMPORTANT settings after installing WordPress
- 10 important plugins for a new WordPress site
- Demystifying WordPress theme structure [Beginners guide]
Mastering WordPress slugs and optimizing them for SEO is an absolutely important step and we hope you will be able to change your post slugs more effectively after reading this article.