Meks
Do you know you can try any of our premium WordPress themes for free?Show me the themes
What is a slug in WordPress (and bad practices you should avoid)?

What is a slug in WordPress (and bad practices you should avoid)?

15Shares

Searching for the next topic we could cover in our blog; we came up with this very interesting and very much in demand question.

What is a slug in WordPress?

What does it mean, why is it important, how to use it properly and what to avoid are some of the additional questions WordPress users have about this. So, naturally, it was a challenge we wanted to accept so, here goes. Sit back and read on this detailed guide on slugs in WordPress and how to use them in the best possible ways.

Top WP Hosting recommended by Meks

What is a slug?

First things first, a slug (whether in WordPress or any other CMS) is a piece of URL that contains page’s or post’s name. Not like in the media industry, where a slug refers to (usually) three main keywords above the headline. Its purpose is to point out the context of a headline and journalists and media agencies use it quickly explain what the news is about to each other.

In online media, like in the example below, it’s this piece of URL that comes after the domain’s name:

what-is-a-slug-in-wordpress-bad-practices-to-avoid

Basically, it’s a user-friendly piece of text within one’s URL and a vital SEO component of your site. And, it doesn’t (and shouldn’t) have to be the same as the headline.

Now about WordPress slugs

WordPress slugs are one of the critical SEO components and are used to set further up and improve your content visibility. It serves to explain to both people and search engines what your page or post is about. WordPress itself describes it like this:

The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.

It goes hand in hand with Permalinks and its settings. WordPress by default uses URLs which have day and name in them which you can easily customize in a way that best suits your needs:

Whether it’s important to you to have a day, month, numeric number or just post name, you can modify your site permalink structure on which the slugs come in. You may have already read some discussions on the best practices that you should use. While some people stands behind the idea that it is important to have a “date string” or a “category prefix” included in your post URLs, others prefer a “Post name” only, to make the URL more human readable.

On our Meks blog, we use “Post name” option for permalinks as we think it is easier for people to recognize the articles as a good result when they search on Google. It is always up to you to decide, but the only general recommendation is to avoid using “Plain” option. It is not SEO friendly neither it helps your visitors to recognize the topic of the article by reading “p=657” in your URL, right?

How to set up or change WordPress slug in Posts and Pages

First of all, your slugs should be short, concise, on the point and easily understandable. Just because you have a long headline, doesn’t mean your WordPress slug needs to be, too. Like in this example below:

what-is-a-slug-in-wordpress-screenshot-example

Let your slug be as easy as it can be, both for humans and Google, no need to stuff it with all the words headline has. That way, they are easier to remember and engage with, and you’re improving your visibility chances. Especially if you put your target keywords/keyphrases in it (only if it fits naturally). More on the SEO benefits later on.

Now, how to set up slugs in Posts and pages? A piece of cake! Whether you’re writing a new or editing old Post, this is what you’ll do.

Open your Editor and click on the Edit button below the Title box and next to the Permalink:

what-is-a-slug-in-wordpress-how-to-set-up

Once you do that, you can set up or change the WordPress slug to whatever you want, just like this:

what-is-a-slug-in-wordpress-how-to-set-up-1

And when you’re satisfied with the outcome just remember to click Update, so the changes are implemented.

Now, there’s another way to do it, that doesn’t involve opening the Editor itself. When in All Posts, click on the Quick Edit feature below the

Post which slug you want to set up or change, and you’ll get this:

what-is-a-slug-in-wordpress-quick-way-to-edit

Look for the Slug box and change it to the one you prefer. All done!

The same principle (both of them) goes for setting up Page slug. Just go to pages and click on the one you want to set up or modify, click on Edit (Page) then the Edit button next to the Permalink and change the slug to whatever you prefer:

what-is-a-slug-in-wordpress-how-to-set-up-2

Update it, and it’s done!

How to edit WordPress Category or Tag slug

Whether you’re adding a new Category or Tag, the editing principle is the same as for the Posts and Pages.

what-is-a-slug-in-wordpress-category-change

Go to Posts and choose Categories or Tags, and look for a Slug box or Edit button (if you’re modifying the existing one), then enter the desired slug, click Add new or Update any you’re good to go.

what-is-a-slug-in-wordpress-tag-change

How to change the Author Slug

In some cases, you might need the help of a specific WordPress plugin to add additional slug changes. Like, when you need to change the Author slug which can’t be done within the WordPress itself. That’s where this neat plugin comes in.

Edit Author Slug

what-is-a-slug-in-wordpress-edit-author-slug-plugin

Just because you can’t change the Author slug within the WordPress itself, doesn’t mean it can’t be done. Initially, the Author slug is his or her’s username. If you want to change it, this is a plugin for it. It helps you gain full control over all user role permalinks allowing you to edit and change it the way you find fit. With it, you can change the

http://example.com/author/username/

to

http://example.com/author/content-guru/

You can even play with the user roles to make the difference more fun like:

http://example.com/ida/master-splinter/ (for an Administrator Role),

or

http://example.com/koga/leonardo/ (for a Subscriber Role).

How cool, right?

WordPress slugs and SEO

As mentioned before, WordPress slugs are vastly crucial for your overall SEO. The way you use and format them can make or break your site and its SERP results. If you want to rank well with your website or a blog, besides the quality of the content, all the rest features need to be optimized, slugs included. Just as you optimize your content with the proper keywords and On-Page recommendation, you should do the same with slugs. Help people find you and your content by implementing Google’s rules.

By doing so, you’re improving the chances your content will be among the results people search for. So, no generic names or numbers because it only confuses people. You want them to understand what your Post, Page, Category is about just by looking at the URL. That way, they can decide whether it’s valuable and relevant to them and might click on it to engage with the content you made.

One more important thing to point out – don’t change slug after publishing the content or all of your SEO efforts will go down the drain. Post-Publish changes will make you lose positioning, ranking and future traffic so, a big no-no.

But (there’s always a but)…  In case you do need to change the original slug and don’t want to lose SEO ranking, you can do it with this plugin.

Redirection

what-is-a-slug-in-wordpress-redirection-plugin

Basically, once you change the slug of a post, you can easily create a redirect rule and links to your “old-slug” will point to “new-slug”. This is a nifty plugin which generally helps you declutter the mess you made by managing 301 redirections and 404 errors which, ultimately, improves your ranking. So, the next time someone clicks on the link that had an old slug, it won’t get a 404 error page but the real deal, and you won’t lose traffic potential. Moreover, with it, you can see and check your error pages and fix them too.

WordPress slug do’s and dont’s

As per Google’s recommendation, these are the main do’s, and dont’s when setting and changing slugs in WordPress (or any other CMS).

Do use:

  • short words, 3 to 5 is best practice
  • relevant keywords and phrases
  • lowercase letters

Don’t use:

  • lengthy URLs
  • cryptic URLs that contain few recognizable words
  • generic page names like “page1.html”
  • keyword repetition (avoid being spammy)
  • stop words (and, the and similar)

Conclusion

The way you use your URLs and slugs are directly connected to both your website accessibility and ranking. In the best interest of your content and people you want to attract, consider implementing these tips to improve your performance and presence. Make your WordPress slug short and simple, relevant and with target keywords, and do not change them once you hit Publish button.

Hope this guide helps you in getting your slugs in order. Feel free to share it with your friends if you find it valuable and do share your thoughts and slug best practices as well.

15Shares

Tags: ,

Ivana Cirkovic

Ivana is a Digital Marketing, PR and Social Media consultant with over nine years experience in the field. She is also a WordPress enthusiast and an active member of WordPress community who lives online almost 24/7. In love with Twitter, WP, photography and NYC.

Try theme now for free!
  • Access to a copy of the demo website
  • Full access to the theme options
  • No credit card required

* We will send you an occasional newsletter with special offers, news & theme updates but you can unsubscribe at any time.

Meks