What is a Slug in WordPress
Table of Contents
Before diving into Slug details, let us see what is a permalink in brief.A permalink is the permanent URL of your post/pages/category/tags in WordPress.It is generated based on the permalink settings in the WordPress Admin dashboard.We can go to Settings–>Permalinks to find and edit the permanent URL settings or permalinks settings.If the permalink settings are selected as a post name like www.example.com/sample-post/,the permanent URL for a post with title hiking would be www.example.com/hiking/.This is the default URL creation with post title at the end of the domain name. The post title here hiking gets appended to the end of the URL by default and is known as slug which can be edited by the user as per need.so now let us go into Slug details.
What is a Slug in WordPress
Slug is the part of the URL that can be edited by the user to match the SEO needs of the post for visibility and ranking in the search engine.It should be unique. In WordPress, Slug creation depends upon the permalink settings.As explained above in the case of post name, WordPress automatically generates the post title as slug by default which can be edited by the user.so if we have our permalink settings as post name, then for a post titled surfing for example.com
permalink would be as follows
www.example.com/surfing
What is the difference between permalinks and slugs
Permalinks are permanent complete URLs while slugs are names of the post/pages/categories/Tags in the permalink.slugs are used to make the permalink structure user-friendly and search engine friendly.Let us see the difference with an example.so from the above example of surfing post, we have the permalink as
Permalink
www.example.com/surfing
Slug
surfing
Here Surfing can be edited as per post needs.
Types of Slug in WordPress
we generally have five main types of slugs in WordPress
1.Post slugs –The slug is created when a post is created.
2.Page Slug –The slug when a page is created.
3.Category –The slug when a category is created
4.Tags –The slug when a tag is created
5.Author Slugs –,WordPress does not offer the option of creating an author slug for a multi-author WordPress site.Edit Author Slug plugin/WP Author Slug.WP Author Slug creates an author slug that prevents you from displaying your login name as an author through the author’s archive URL.
Role of Slugs in WordPress SEO
In general, Slugs include target keywords for a post.This helps search engines understand the context of a post so that correct content is ranked first.It gives the URL a user-friendly and search engine optimized format.A cleaner and relevant-looking URL in search results not only helps in ranking but also in conversion.so slugs are an important part of URL and WordPress SEO.
How to edit the Slug in WordPress
Editing a slug is needed to optimize it for including keywords to rank for.Changing a slug changes the URL.Slugs should be edited carefully as the content won’t be available using the old URL.So redirect from old URL to new URL has to be set using 301 redirects.Editing a post slug
1)Click on Post–>All Posts–>click Edit for the required post.
2)Click on Edit permalink and edit and click on update to save the changes.or
1)Click on Post–>All Posts–> Click quick Edit for the required post.
Editing a page slug
1)Click on Pages–>All Pages–>click Edit for the required page.
2)Click on Edit permalink and edit and click on update to save the changes.or
1)Click on Pages–>All Pages–> Click quick Edit for the required page.
Editing a category/Tag
1)Click on Post–>Categories/Tags–>click Edit for the required Categories/Tags
2)Click on Edit and click on update to save the changes.or
1)Click on Post–>Categories/Tags–> Click quick Edit for the required categories/Tags.
How to optimize Slugs
Slugs help in setting the target keyword to rank for.Keep following things in mind while optimizing slugs
1.Slugs should include target keywords that should be descriptive but not lengthy.It helps in giving idea to the audience about the content.A post such as how to start blogging with permalink as example.com/how-to-start-blogging has slug as how to start blogging which gives the audience an idea about what to expect from the post.
2.Slug should not have unnecessary joining words like a,an,the, etc.Try to keep words that are only must be required.
3.Set up a redirect for changed slugs by pointing the old permalink to the new one.