This is feature image

What is a Slug in WordPress: Change and Optimize WordPress Slug

Published by on October 14, 2023
Categories: BLOG WORDPRESS

In WordPress, a slug is a part of the permalink that helps to uniquely identify a post or page on the WordPress website.
A slug is unique and only refers to a specific post or page. A slug appears after the domain name.

Consider an example: This URL, “https://yourwebsite.com/your-first-blog-post,” is now called the permalink.
The only part of “your first blog post” is called the slug.
WordPress automatically generates slugs by default. To generate a slug, WordPress replaces the space between words with a hyphen.
You have the option to edit the slug or modify the settings of the WordPress permalinks.
In this article, we will explain how to edit or change a slug and make it SEO-friendly.

Why change the slug in the post?

WordPress allows users to select a permalink structure for all posts. In the permalink setting, we specify the element that should be included in permalink. We have the option to add the category, post name, post date, and time, among other things.
If we include a post name in the permalink setting, WordPress by default takes the full post name as part of the slug.
A long post name can cause the permalink to be lengthy, and we also require an SEO-optimized permalink.
For SEO purposes, we have the option to edit or change this post name slug.

The purpose of this section is to teach you how to modify the permalink when publishing a post. Although it’s possible to change slugs after publishing a post, it’s best to make a careful decision on slugs and permalinks and refrain from changing them later. Because when a permalink is listed in the search engine, it may cause a 404 page to not be found if you have changed the permalink of the post or page.

How to Change Permalink Settings in WordPress

Prior to changing or editing the slug, it is crucial to know how to set permalinks. Optimizing your slug in individual posts or pages is possible if you include a post or page title in the permalink
It is possible to select various combinations for your permalink.

Options are:
There are five predefined permalink settings that you can choose from. Or you can create a custom structure for permalinks.
In the custom structure for permalinks, you can add the category name, post_id, post name, etc.

What is a Slug in WordPress

What is a Slug in WordPress

Before publishing your first post, make any necessary changes to the permalinks. Changing it later will result in the old link being considered as a broken link. Search engines may encounter a 404 error when searching for old links because they were already indexed prior to modification.


Setting redirects for broken link pages and removing them from search engines and the XML site map is a way to fix this problem.

How to Change the Slug in WordPress

The purpose of this section is to teach you how to modify the permalink when publishing a post. Although it’s possible to change slugs after publishing a post, it’s best to make a careful decision on slugs and permalinks and refrain from changing them later. When a permalink is listed in the search engine, it may cause a 404 page to not be found if you have changed the permalink of the post or page.

Changing Post Slug

To change the slug in the post page, Go to the follow the steps:

What is a Slug in WordPress
  • In dashboard left pan Posts -> Add New
  • In Post page select the Post tab in the right pan.
  • Now click the URL (1).
  • A new window will appear, you can edit it in the PERMALINK box (2).
What is a Slug in WordPress

To save the change click the Publish button

Changing Page Slug

To change the page slug go to the dashboard left pan -> Pages -> Add New

wordpress slug

1. To change the slug of the page, Select to the Page tab in the right pan.

2. Now click the URL.

3. A new window will appear, you can edit it in the PERMALINK box

wordpress slug

How to change Category Slug in WordPress

Go to dashboard left pan -> Post -> Categories

wordpress slug

1 If you want to create new category, add the category name in the Name filed. 

2 Add slug in the category Slug box

3 Click Add New Category

What is a Slug in WordPress

If the category is already created you can edit its slug as follows.
1. Click Edit in the category list.

What is a Slug in WordPress

2. Edit slug in Slug box.

3. Click Update.

What is a Slug in WordPress

How to change Tag Slug in WordPress

Go to dashboard left pan -> Post -> Tags

What is a Slug in WordPress

Other steps are similar to what we did in the category slug section.

How to change Author Slug in WordPress

Go to dashboard left pan -> Users -> All Users

Choose the user in the Author list and click Edit.

What is a Slug in WordPress

The next step is the same as in the category change.

How to Optimize WordPress Slugs for SEO

Optimizing WordPress slugs is important for website SEO. By optimizing slugs, we can improve our search engine result pages (SERPs) ranking.

Here we will explain how to optimize your posts and page slugs.

Including key phrases in the target keyword

Search engines also examine keywords in your URL to know about your WordPress page contents. URLs with descriptive words or keywords also attract visitors to click the link and guess about the page content.

For example, let’s look at the following link:

“https://it10x.com/what-is-a-personal-blog/”

Now you can see the permalink of the post. What is a personal blog?

In this link, a personal blog is a keyword.

Now search engines can know about page content by finding this keyword: that page is about a personal blog.

It is also descriptive for humans to know about the content of the page that has information about the personal blog.

Some points to consider while creating a slug

Keep slugs short

Don’t include the full title in the slug, by default WordPress adds the full title in the slug if we have set the title as part of the permalink in the permalink settings.

Remove irrelevant words and make it short.

Don’t use words like a, the, to, on, at, and in, etc.

Avoid Change to Permalinks

Don’t change the permalink after submitting the URL to search engines.

Use unique slugs

Make your slugs unique for each page and post; don’t add similar keywords to more than one page and post. This strategy is not good and can create conflict while search engines have to optimize one page for one keyword.

Avoid using IDs, dates, times, and numbers

Numbers and id are not descriptions for humans, and search engines cannot understand IDs and numbers, so these are not good for SEO.

Use evergreen slugs

When we use dates in slugs, as time passes, they look old, and people don’t want to see old content, so it decreases your page’s CTR.

We can update content in the future, but we cannot change slugs or permalinks; it creates the problem of broken links and will affect SEO.

So use evergreen slugs, which we need not change in the future.

Conclusion

By default, WordPress slugs are not SEO-friendly. To get more traffic, we have to optimize slugs. This article explains how to change the slug in WordPress for blog posts, pages, post categories, tags, and authors.
We hope it will help you optimize your slug and permalink.

Related Posts

Gurjit

Gurjit Singh is a Content Writer and Web developer. He has experience in theme development, front-end development, and digital market. He loves to share his knowledge to help others in creating Websites, WordPress blogs, and SEO.