WordPress Slugs What Are They & How To Change Them - WPQuickies

WordPress Slugs What Are They & How To Change Them – WPQuickies

WordPress automatically creates “pretty permalinks” for its posts, and many people forget to optimise post URL slugs for SEO rankings and human trust.

What Is A Post Slug?

WordPress defines the post “slug” as the combination of words after the website domain name.

what is a WordPress slug?

Each post on a website should have a unique URL, and slugs are a way to make that happen.

Parts of a URL

Let’s break down the parts of an imaginary example URL “https://www.myblog.com/pets/my-pet-cat”.

parts of a URL

The first part of the URL tells the web browser which protocol to use.  The web protocol can either be the unsecured “HTTP://” or the secure “HTTPS://” as used in this example.

Next comes the subdomain “www”, followed by the second-level domain “myblog” and finally the top-level domain “com”.

Sometimes a URL will not contain a subdomain, just displaying the 2nd-level and top-level domain names such as “https://myblog.com/”.  A URL without a subdomain is called a naked domain.

The next part in the URL is the subdirectory “pets”.  Multiple sub-directories in a URL allow hierarchies.

Humans and search engines expect all the sub-directory “pets” web pages to associate with pets.

The very last part of a URL is the slug “my-pet-cat”.  

WordPress can automatically create the slug from the post title, placing spaces with dashes in lowercase letters if you have “pretty permalinks” enabled in Settings > Permalinks.

What Are WordPress Permalinks?

Every post in WordPress has a unique ID associated with it.

Posts are stored in the database and need a unique ID to find, read and update post content and related metadata.

The default install of WordPress uses these post IDs in post slugs, and it’s pretty ugly.

WordPress permalinks settings

Your website slugs are in the format “?p=123” which is useless to search engines and humans.

Any other option is better, but I recommend using the “Post name” option allowing you to add descriptive slugs.

Once you have pretty permalinks enabled when creating a post, WordPress uses the post title to make the slug in all lowercase and spaces are replaced with dashes.

WordPress Post edit title and slug

You can change the slug to anything you want. The default is only a suggestion from WordPress.

Click on the Post > Permalinks on the editor’s RHS settings bar, and you can enter any words to make up your slug.  You can even add emojis, but you probably shouldn’t.

WordPress slug with emoji

Slugs In Taxonomies

Posts aren’t the only URLs that use customisable WordPress slugs.

Categories and tags also use slugs that you can customise and edit.

WordPress categort slugs

E.g. https://zpddemo.wordifysites.com/category/home-cooking/

WordPress tag slug

E.g. https://zpddemo.wordifysites.com/tag/keralan-curry/

Slugs in Custom Post Types

Some themes and plugins define new WordPress Custom Post Types (CPTs).

WooCommerce is a good example that creates a Custom Post Type called “Product”,

WooCommerce allows product URLs to have a custom slug.

WooCommerce product slug

Optimise Slugs For SEO

The URL of a web page is important for SEO.  

Search engines will look at the URL and, more specifically, the slug to determine the post content’s meaning.

If you want to rank your web content higher in the search engine results, you should consider making your slugs SEO friendly.

Here are a few SEO tips that you can use with your slugs.

Short and Descriptive Slugs

Ensure you include the main keyword you are trying to rank the web content for in the slug, preferably the first word.

Short and descriptive slugs

Use words that help to describe the page to a human.

Don’t Replicate The Page Title

WordPress creates a post slug using the words from the post title.  

The page title and the slug have two different jobs.  The page title needs to be readable for humans and grab their attention to read the post.

Don't replicate page title in slug URL

Slugs need to be descriptive for humans but, more importantly, keyword-focused for SEO.

Avoid Dates In Slugs

WordPress has a permalink option to include dates in your post slugs.

I recommend that you don’t include dates in any of your post slugs.

Date-based content can quickly become irrelevant and can score low in search results.

Choose Your Slug Before You Publish

Decide on your post slug before you push the publish button.

Once the search engines have ranked the page, you may lose SEO juice if you decide to change the page URL after publishing.

If you need to change a page URL, use a redirection tool to redirect the old URL to the new one.

Remove Stop Words

Stop words are single words that grammatically glue sentences together, but that is not necessary to understand the underlying meaning of the sentence.

Examples are “the”, “a”, ‘an’, “another”, “for”, “nor” and “but”.

I have an article on my WilBrown.com website that explains what stop words are, with a list of over 650 examples.

Target SEO Keywords

The URL slug is an opportunity to include the SEO keywords you would like the content to rank for in the search results.

Adding SEO keywords to your slug does not guarantee that search engines will rank your content for those exact keywords, but it helps with the overall context and description.

PRO TIP – Use an SEO plugin like SEOPress to ensure your slug keywords are relevant to your page content.

SEOPress content analysis

Summary

WordPress slugs are an essential part of your post URLs for humans and search engines.  

Make sure you take time to optimise your slugs for your web content.

Do you still have questions about WordPress slugs?

Ask in the comments below.

#WPQuickies

Join me every Thursday at 1 pm Sydney time for some more WPQuickies – WordPress tips and tricks in thirty minutes or less.

Broadcasting live on YouTube and Facebook.

Suggest a #WPQuickies Topic

If you have a WordPress topic you want to see explained in 30 mins or under, fill out the form below.

https://forms.gle/mMWCNd3L2cyDFBA57

Watch Previous WPQuickies

Was this article helpful?
YesNo