What is a slug in wordpress?

      No Comments on What is a slug in wordpress?
What is a slug in wordpress

If you manage a blog or website in WordPress, you will come across this term related to your pages’ URLs. But what does it mean? What is a slug in wordpress and what is it for?

What is a slug in WordPress?

When we talk about slug in WordPress, we refer to a part of the URL that determines and informs which page within a website we are browsing. Explained in another way, it is what follows your main domain in the web address. Let’s develop and see it more clearly in an example:

https://abs.com/wordpress/a-b-c

Here, what follows the main domain of the website, is the slug.

Let’s look at another case:

https: //abc.com/a/b

You will notice that in this example, there are 2 pieces of text, separated by bars. One of them “a” belongs to the page that I use as a directory and access to the digital books that I offer on my website, and the next “b” is the one corresponding to the sub-page that contains the book to download. Categories and tags are part of slugs.

What is a slug in wordpress

Slugs and Permalinks

Slugs are linked directly to permalinks or permalinks. Remember that in the WordPress Dashboard, if we access Settings > Permanent links through the side menu, we can adjust some parameters to create a custom URL structure.

We have several predefined options and the possibility of making our combinations with the year, month, day, time, title, category, etc. By default, WordPress provides us with URLs like the following:

https://abc.com/xyz

In this example, “xyz” is the id of the page, but … it is not at all friendly to read.

Precisely for this reason, we can choose a custom structure for our URLs.

In the example below, the URL is built from my domain + post title :

https://abc.com/a-b/

I could have added the category or the year, but I prefer to simplify the article address even more. So the slug, in this case, is made up of the post title.

WordPress automatic slug

WordPress will assign one based on the title we have given to our post or page if we personalize the permanent links and do not work with the default option. Of course, applying minor adjustments such as the following:

  • Will replace spaces with hyphens
  • Will transform everything to lowercase
  • The letters ñ will be changed to letters n
  • Will dispense with accents and symbols, such as ¡? $ #
  • You can see the example of this by reading the title of this article and its slug.

How to modify the Slug in WordPress

The CMS allows us to change the slug of a page or post. If we are not convinced that WordPress has automatically assigned, we can manually replace it with one of our preferences.

We customize the URLs in two ways:

  • From the editor

When we are editing a page or post, we will have the option to replace the slug above the title with Gutenberg. In the classic editor, we will have it exactly below.

  • From the list of posts or pages

Through the Quick Edit option, we can modify it without having to enter the editor.

We have seen how to customize the URLs corresponding to the pages and posts, but we also said that a category or tag is part of a slug. So how do you change this?

In Posts > Categories and Posts > Tags, you can create and modify existing ones.

In Settings > Permanent links, you can also define a category and base tag.

Understanding what this is about slugs and permalinks in WordPress, already knowing how to modify them, let’s go to a pervasive question that is probably running through your mind now.

Is the slug important for SEO?

Having a friendly URL is always positive from the point of remembering, quickly reading a web address, especially if it is optimized.

We saw that WordPress automatically assigns the permalink based on the title of the post or page. In the first example, use the “what-is-the-WordPress-slug” slug.

But if I wanted to optimize it, I could modify it by “slug-WordPress”, dispensing with words and articles, focusing only on the 2 that I want to position and discard others. This is at your discretion, of course.

If you wanted to position the entire title phrase, you could leave it as is. Putting other examples, it is much easier to remember:

http: //abc.com/0987

http://abc.com/123 than abc.com/zxy

Modifying the slug after having published the content and it has been indexed in the search engines can be a headache, since when someone clicks on the result, they will arrive at the famous Error 404 Not Found or “No results found.”

This will involve redirecting the old URL to the new one.

We will have the same problem if we already link our content on a third-party page, such as another blog or even social networks. It is a prevalent practice and recommended to share all our content on these platforms.

To save yourself work, you should decide the words that will make up your slug before publishing the content.

Tips for optimizing slugs in WordPress

  • Keep them as short as possible
  • Use keywords (keywords)
  • Discard words like “from”, “is”, “the”, “in”, “to”, “and”

I admit that I often forget that last point because I am in a hurry or because I am doing several things at the same time. However, it is something that I am always trying to correct. And you were you applying the slugs correctly in WordPress.

Leave a Reply

Your email address will not be published. Required fields are marked *