Home » WordPress Tutorials » Basics » What is Slug in WordPress

What is Slug in WordPress

Basics

Due to the rise of the technology industry that we have observed in the last decades, especially the last one, Search Engines are becoming a more and more substantial factor for business success. If the search engine doesn’t show your website, it could as well not exist for most of your potential customers. Therefore you need to take care equally of your content and for it to be relevant to the users’ queries in the Search Engines.

A small but important step in that direction is understanding permalinks and slugs. And as we’ve mentioned in our article on permalinks, it is crucial to think about the structure before your website is ready. In fact, if you have any hopes of getting substantial traffic to your online property, you need to think about the permalink and slug structure, while you are creating your WordPress website.

 

What Exactly is a WordPress slug?

The slug, be it a category or post slug, is building part of the permalink. What is a permalink?

The slug is that part of the permalink that identifies the exact page, post, or category.

Say, you are writing an article about the polar bears. WordPress will automatically generate the slug, using the title. But you can easily change it to whatever you want.

Of course, we highly recommend keeping the slug relevant to the title of the article. If the title you’ve chosen is something like Basic Facts About Polar Bears you can change the slug of the post to be /polar-bears/. So, when a user enters the article he or she will see the title, but the post will be located at www.yourgreensite.com/polar-bears/.

This way when someone is searching for polar bears on Google there is a higher chance for your article to get higher positions. As you can imagine, the slug in WordPress is as important as the slug on a site created in any other way.

 

How to Customize the Slugs in WordPress

In order to be able to customize the slugs on your WordPress website, you’ll have to change the default permalink structure. As the slugs are a part of the permalink WordPress gives you the option to edit them.

By default, they are “plain”.

You can find out how to change that so that you’ll be able to customize your slug in WordPress by taking a look at our WordPress Permalink article.

 

How to Edit Post Slug in WordPress

You have the option to change the post slug at any time. We highly recommend choosing it while creating the post or the page and never changing it. Except in case you’ve misspelled it, the best practice is not to change the post slug and permalink for that matter.

Even if you misspelled it if the post is old it is better to leave it as it is.

On the other hand, if you want to change the post slug that was created automatically out of the post title, you can do that on the same page, and at the same time that you are creating the content.

Right after the post title bar, there is information and a link to the newly created content. If the post is assigned to a category the link says Permalink: domainname.com/category-name/post-slug. Otherwise, the link will be similar to the one in the image below.

Just next to that link stands an Edit button. If you are not satisfied with the automatically generated post slug, click that button and change it to your liking. Bear in mind you need to use dashes “-“ instead of spaces.

How to Optimize the Post Slug?

As we mentioned, the slug’s structure is really important for the Search Engines.

People are searching for words, not numbers. Your content is most likely also written in words, except if you have a blog dedicated to the beautiful science, called mathematics.

After you’ve changed the permalink to end with the post name, the post slug will be automatically generated out of the title of the article. And you will be able to change it. The slug, as you already know, should be related to the content and the title of the article.

It should be keyword rich. And last but not least as short and meaningful, as possible. You should leave the slug to be easily understandable but at the same time not too long.

All of this is important for your On-page SEO.

Was this post helpful?

i

Relevant tags:

Create your WordPress website today!

Connect

Editor’s picks:

Gutenberg Tutorial: How to Move Blocks in WordPress

What you need to know: The WordPress Block Editor allows you to move blocks up and down the document structure in order to rearrange the content contained within those blocks. The most popular way of moving blocks is by dragging a block from one position and dropping...

Gutenberg Tutorial: Deleting a Block in WordPress

What you need to know: You can delete a block in WordPress by selecting it and pressing the Delete key on your keyboard. Alternatively, you can press the three-dot button in the Contextual Toolbar to access the Remove block option. Lastly, it is also possible to...

Gutenberg Tutorial: Using Block Patterns in WordPress

What you need to know: A block pattern in WordPress is a group of two or more regular WordPress blocks. These blocks come in a sensible layout that you wouldn’t need to modify in most cases. Instead, you just need to add your own content to the block pattern. You can...

Gutenberg Tutorial: Using WordPress Reusable Blocks

What you need to know: Gutenberg features reusable blocks that allow you to quickly insert the same content with one click. You can mark any block or block pattern as reusable. You can find your reusable block collection in the WordPress Block Library. Have you ever...



Create your WordPress website today!


Start now