How To’s & TutorialsUltimate Guide: How to Optimize your WordPress Slugs

WordPress slugs are nothing but words and short sentences we use to describe our posts, categories, tags, and pages on the website, in the result of which those become an integral part of our permalinks, and explain content to our users.


wordpress slugs

Let’s say that the name of your post is “My Post In WordPress”, the slug will consequently be “my-post-in-wordpress”.


Post Slugs use the title of your post to generate slugs automatically, but won’t be automatically transferred to the URL if you don’t enable them to: substituting ”%postname” with its placeholder within the custom structure.


The importance of permalinks and slugs

Analysts in the sector identify hosting as the heart of every website, which makes permalinks and slugs its skeleton. They put the basis and form your website’s outline, critical both for visitors and engines that have to deal with your website.


To be more precise, permalinks and slugs are your content’s digital address, the one visitors have to use to access your posts.


permalink


They typical WordPress permalinks have a multitude of numbers and question marks, which gets a bit messy unless you’re the admin. However, this is not only relevant for the end users, but for the search engines that would otherwise struggle to find your website based on the messy information you’ve provided them with.


Default slugs are somehow better, because the system uses all of the words on that page or page titles, and removes shorter ones (the, a, an, etc) to build permalinks.


That would mean that default slugs are perfect if there wasn’t for two big problems:


1. The first is that these slugs are too messy and long;

2. The second is that the system can lose certain words that may be of relevance to your post.


Why would you let the system build your slugs and permalinks, knowing that the priority is to stay focused on human’s mind? You need to make permalinks motivational and catchy so that the user will open the post and read the rest. Clean URLs, however, are nor relevant and useful only to users search engines find them more beneficial too!


You can also use the posting page to change a slug: all you need to do is to click on the Quick Edit button (somewhere under your post). What you will see is a small editor window where all post slugs can be edited (other things too).


The slugs of categories and tags

Not only posts have slugs on your website, but other categories as well. Therefore, if users click on some of the categories our post is related to do, they will land on a page where all posts under that category are included.


Then, Categories/Tags slugs can also be altered. WordPress gives us what is the basic category slug (in case we haven’t created one) and we apply the very same method as with posts to change them and to save the changes.


categories-tags


How could we create slugs for our categories from scratch? We should go to Posts, then Categories, and use the WordPress dashboard. In order to add a new category, we should think of a creative name, type it in, and use the underneath field to add the new category. In order to save the changes, we should confirm the procedure by clicking on the Add New Category button.


The form will be the same in both of the cases, as long as you’ve typed the category/tab name in, or entered the slug you want. Remember that slugs need to be written in lowercase letters, without spaces but dashes instead.


How can you optimize your WordPress slugs?

WordPress wouldn’t have such varying levels of effectiveness if it weren’t for the large spectrum of ways to accomplish every single task. Said more simply, you have a choice to make things, make them right, or make them perfect. The decision is up to you!


This being said, we’re going to discuss some of the best practices when creating slugs, which is one of the simplest WordPress To Dos, but at the same time one you can’t afford the luxury to mistake.


Using hyphens instead of stop-words

By stop-words, we mean short ones, like ‘a’, ‘an’, ‘the’, etc., and we advise you to avoid them because the search engine is programmed to ignore them. It will surpass them both as indexing entries and search query results.


Using hyphens (-) is very WordPress-like, and you’re supposed to use those instead of under cores (_). Even Google can confirm that’s the right thing to do.


Keeping slugs short and packed with the most significant keywords

If you want readers to remember the slug, keep the URL short and keyword-relevant (including maximum 5 related keywords. According to Google, short, yet descriptive slugs are the best way to go.


Thinking like your users

Think of keywords users would normally type on their search engines, and you will push your slug a step forward for the search engine to discover it. As an example, users are likely to type “How to back up Gmail’, and Google knows it, so it groups content in accordance with it. In fact, Google offers the assistance of an admirable AdWords tool that suggests the best keyword ideas for your post, and while you will find plenty of them to choose from, we advise you to keep with few most relevant ones. Keeping things simple can never fail!


Cleaning the trash regularly to avoid duplicates

When you create a new page/post, you see there a number 2 on the end of it, and the reason for that is that the slug already exists somewhere, and WordPress is warning you about it. Having two posts/pages with the same slug is not allowed, which is why the ugly 2 will remain there until you think of something more creative.


Still, you don’t have to jump from one edge to the other, think of something slightly different (a closely related post or one what hasn’t been published yet) and WordPress will accept it.


You will be surprised to see that WordPress doesn’t allow even the names of posts/pages that have already been deleted, and the reason for it, is that they are still stored in your trash archive. Select all of them using the bulk editor, and empty the trash afterward. This way, you will still get to use old slugs without WordPress reporting it to be a problem.


Thinking before posting

thinking

After you’ve published a page/post, there is no sense in changing the slug. The content, title and even Meta description can be changed, but the permalink will require a 301 redirecting page in order to take visitors to the old URL, and in case you can’t fix it, it will report a perpetual 404 error. Still, if you consider that changing the permalink is an absolute must, let us share a simple HTA Access procedure that will keep 404 errors off the scene:


Redirect 301 /old-post-slug/ http://example.com/new-post-slug/


As you can see, doing it is fairly simple: you need to call the redirecting directive, change its status to permanent 301, and replace the newly suggested slug with the old one. After that, all requests will be redirected to the slugged URL, instead of the new one.


There is one more important thing to remember: Old slugs cannot be deleted!


The reason for that is that removing them can cause SEO momentum loss, meaning that you won’t rank as good as before, and users will most probably land on error pages instead of the right ones.


 •  0 comments  •  flag
Share on Twitter
Published on August 05, 2016 06:45
No comments have been added yet.