Slug is a term used in WordPress to indicate URL friendly version of the post or page title. This is automatically generated by WordPress based on the permalinks settings of the site and can be modified manually. The post title entered in WordPress visual editor is then converted into a simple URL structure during the Autosave or when Save Draft / Publish / Update button is clicked. The structure of the URL depends on the permalinks settings of the blog and the slug is generally created by adding hyphens between each word of the title.
Example of Slug
Below is an example of how WordPress converts the title into a slug.
Structure of Slug
WordPress follows some rules in creating the slug.
- Slug is not case sensitive all letters in the title are converted to small case.
- Space between each word in the title is converted to a hyphen in slug. Any existing hyphens and multiple spaces are ignored.
- All special characters including “question mark (?)”, “exclamation (!)” and “is equal to (=)” are omitted.
Though slug is automatically generated by WordPress it can be changed manually to provide more meaningful URL.
- Slug text box is visible below post content in WordPress editor. “Screen options” has the option to hide or show the slug text box in the editor.
- It is also possible to edit the slug using the permalink URL structure showing below the title.
Slug is very important from SEO perspective since it is the post URL displayed on search engine results. Hence, it is a good idea to keep it descriptive with the desired length so that it will not get truncated. When the length of post title is very long then slug can be modified to generate a short and meaningful URL. Below is an example of modified slug:
Removing Stop Words from Slug
It is also a good idea to remove all meaningless words from the slug without affecting SEO of the article. All words like “the”, “a”, “to”, “in”, etc. are referred as stop words and not add any value in search engine results. Though stop words can be removed, you need to remember and remove them whenever a new post is created. To overcome this, you can use plugins like Yoast WordPress SEO to remove the stop words from the slug automatically. Enable this option under “SEO > Advanced > Permalinks > Cleanup permalinks > Remove stop words from slug”.