March 25, 2019
3 min Read
Ever wondered what is a WordPress slug? In this article, you’ll learn the definition of a WordPress slug and how to set it in WordPress. We will also provide some tips for setting up user-friendly and SEO optimized slugs. Let’s get started.
A WordPress slug is a text which comes after your domain name as a part of your permalink that is leading to your content.
If you add a new post, WordPress automatically generates the slug based on your permalinks settings. You can go to Settings -> Permalinks and change how slugs are generated.
Although WordPress automatically sets the slug, it is not always recommended to leave it like that. The default slug may not be friendly for both search engines and humans.
Before setting your slug, you have to know the two basic rules:
WordPress will automatically correct these rules for you. But, it will be better if you understand this before proceeding further.
You can set your post’s slug while writing or editing your post. Go below your post Title box, and find a Permalink URL. If you can’t find a permalink there, you need to enter your title first. After the permalink appears, you can edit your slug by clicking the Edit button. When you’re finished, click OK.
Similarly to a post slug, setting up page slug is fairly easy. The permalink URL of the page is also located below the page’s name box. Click Edit, type your page slug, and click OK.
WordPress automatically gives a slug for a new category or tag that you made. Yet, if you prefer to set your own slug manually, you need to create a category first and go back later.
For setting category slugs, you go to Posts and choose Categories. Find the category you’d like to edit and click the Edit button. Input your slug into the slug box and click Update to save the change.
Changing tag slugs is similar. Go to Posts and choose Tags. Find the tags you want to edit and click the Edit button. After you input your tag slug, click Update to save the change.
If you have a news website or a website with many contributors, you can also create a slug for each author. Unfortunately, by default WordPress does not allow editing author slug. Therefore, you will need Edit Author Slug plugin. Once plugin is activated go to Users -> All Users. Pick the user and click Edit User, scroll down till Edit Author Slug options. Type in the desired slug and hit the Update User button to save the change.
Many SEOs believe you can get better results in search engines if you include keywords you want to rank for in your URLs. Therefore, it is better if you have the keyword in your slug. You can even use your target keyword as your slug.
Short slugs are more likely to rank in Google and are more user-friendly. Thus, it is better to make your slugs short and on point to your targeted keywords.
We recommend cutting out the unnecessary words from your slugs, including stop words such as “a,” “the,” “and,” and other similar words. If you use the Yoast SEO plugin, you will be assisted in cutting out these words from your permalink.
When you change WordPress slug, the whole URL changes. This means that users and search engines will not be able to find the content using old URL. If it happens that you need to change already existing slug, we recommend setting up 301 redirect from old to new slug. You can easily do this with SEO Yoast or Redirection plugins.
You may also want to check out what WordPress hosting plans Hostinger has to offer. All plans have a powerful Control Panel, easy website builder with drag & drop function. You’re 1-click away from fast, secure and scalable WordPress hosting!
So now you know that WordPress slug is a text that comes after your domain and is a part of your permalink. Optimizing and setting up the slug in every post, page, category, and tag can result in a more friendly website for both humans and search engines. We hope this article helped you to implement the best slug practices.