PHPMatters Help You Better Hosting Your PHP-based Sites
Beginner's Guide on WordPress Slug

Beginner’s Guide on WordPress Slug

If you are new to the WordPress script, there are a lot of basic elements you need to learn and master for the effective utilization, such as the permalink structure, visual editor, attachments, featured image and many more. This time, we’d like to introduce a new term – WordPress slug, telling you what the slug is on earth along with some tips for optimizing it.

Definition of WordPress Slug

In fact, the slug is just a few words that can be used to describe the main content of a page or a blog post in the permalink. By default, WordPress will generate the slug automatically for your posts or pages based on the content title. However, to make it as URL friendly as possible, you generally need to modify the slug in a manual way.

For instance, in this post, the default slug will be “beginner-guide-on-wordpress-slug”. To better optimize it, you can change the slug to “wordpress-slug” directly.

Default Permalink

In addition, the WordPress slug can make sense only when you enable the “postname” option in the permalink settings.

Permalink Common Settings

Where Will the Slug Appear in Your WordPress Site?

Now, you need to figure out where these slugs will appear in your WordPress powered websites. In the common situations, there are 4 locations.

Blog Posts and Webpages

These are surely the most obvious options. As you can see in our previous example, this special system will generate the slug for each of your post and page right after you enter the title into the title box. If you are not satisfied with the slug, you have the freedom to edit, and then, save your preferred version before hitting the publish button.

Tags and Categories

These two options also allow you to have the slug created. Each time you create a new tag or a new category, you must enter the name and type your wanted slug that is in the lower case and is integrated using dashes but not the spaces.

Category Slug

How to Optimize Your WordPress Slug?

There is an interesting situation that almost all the WordPress components can be further optimized for the higher degree of effectiveness and efficiency. The slug, surely, is not an exception.

With this in mind, we are going to list some useful tips telling you how to optimize your WordPress slug to achieve the best page structure, reading experience and the search engine optimization.

Use Some SEO Keywords into the Slug

First of all, it would be better for you to include some keywords into your slug. Especially, if you already enter the keywords into your post titles and meta descriptions, this practice can triple the effects of SEO optimization.

Simplify Your WordPress Slug

In most cases, the slug is created as a complementary item to your current permalink structure that already includes your domain name, or even has the publishing date of the blog content, content category and post name.

Due to this, you need to make your slug as simple and short as possible using some specific words that can fully describe what you have said in the content. This can make both real readers and search engines feel easy to read and understand your link.

Never Use the Same Slug In More Than One Time

When managing your WordPress site, have you ever found that some of your categories, posts, tags and pages have the number “2” or others attached to the end of the URLs? If so, it means you have duplicated your WordPress slugs. As WordPress does not allow the same slug to appear in more than one time, it will leave an ugly number in the URLs.

Personally speaking, this can hurt your SEO to some degrees and can devastate your whole professionalism and authority in a specific field. In this case, you need to try your best to avoid the slug replication.

Do Not Duplicate

If this happens, you can fix the issue simply by changing the offending slug. If the posts are closely related, the modification can be minor.

After doing so, if this problem still happens, you should check your trash box to figure out whether the deleted posts have the offending slug. If so, you need to delete them permanently.

Make the Slug Highly Relevant to the Main Content

We have found that many webmasters sacrifice the aspect of relevancy and only seek for the simplicity and the inclusion of keywords. This is totally wrong. You can cut and change some words from the default slug, but the prerequisite is that your slug can fully cover your web content.

Do Not Change the Slug After Publishing

This can be a stupid mistake that might be made by some newcomers. In fact, if you publish a post or a page, and then, change the slug, this means you have altered the URL. In this case, the link directing your readers to the right content will be broken, and the 404 error occurs. Note that broken links can result in the loss of online ranking and organic traffic.

Due to this, you’d better avoid the change of slug after content publishing. However, in some cases, you may need to do this. If so, the redirection practice cannot be ignored.

You can finish the redirection by editing the .htaccess file or using the plugin. Personally, we recommend the later option. This time, you can try the Redirection plugin.

To add the new redirection, you should click Tools > Redirection. After that, you can enter the source URL, choose the action of “Redirect to URL” and type the target one. After clicking the Add Redirect button, you can fix the error even if you have changed the slug of a published post.

Add New Redirection