WordPress Slugs: What They Are & How to Change Them

Anna Fitzgerald
Anna Fitzgerald


Are you wondering what a slug is in WordPress? Trust us, it’s not as gross as it sounds.

person changing wordpress slugs on a laptop

When search engines crawl a page on your site, they look everywhere for clues to what your content is about: the title, headers, body text, image alt text, meta description, and even the URL.

In fact, URLs are one of the first elements search engines crawl. For these reasons, optimizing your URLs is an essential step in improving your on-page SEO.

URLs also contribute to your visitors’ first impressions. URLs that are too long or contain strings of random numbers and letters appear less trustworthy than URLs that convey information about the page. Usually, the culprit here is the URL slug.

In this post, you'll learn what a slug in WordPress is and explore some best practices for optimizing them. Then, we’ll look at the different ways you change them on your WordPress website.

Grow Your Business With HubSpot's Tools for WordPress Websites

To understand what a slug really is, let’s briefly look at the different parts of a URL. We’ll break down this post’s URL:


From left to right, we have:

  1. The scheme — most often you’ll see https:// (or http:// if the page isn’t SSL-encrypted).
  2. The subdomain, like “blog” in this URL or simply “www” in others
  3. The second-level domain — the name of the website (“hubspot” in this case)
  4. The top-level domain, which is most often .com, but could be .org, .net, .io, etc.
  5. The subdirectory, which comes after the first slash. This indicates what subsection of the website we’re on. A URL can have one, multiple, or no subdirectories. In this post, the subdirectory is “website” because we’re on the Website section of the HubSpot blog.
  6. The slug, which comes after the second slash and identifies the specific page within the subdirectory.

Before we walk through how to change the slugs on a WordPress site, let’s review some best practices for optimizing them.

WordPress Permalinks vs. Slugs

With WordPress, the terms “permalink” and “slug” are sometimes used interchangeably when referring to URLs. However, there is a difference. A permalink is a permanent URL of a post or page on your website. A permalink should not change once the page/post is live, hence the name.

A slug is a part of a permalink. More specifically, it’s the name of the page or post at the end of the permalink that makes it easy for readers and search engines to understand what the post/page is about.

How to Optimize a URL’s Slug in WordPress

Designing for humans and bots should be a guiding principle for everything you do as a site owner, and that includes optimizing a URL’s slug in WordPress. Consider the following URLs:




Which one makes more sense to you? Probably the first one, which is why slugs make more of a difference to the user experience than you might think.

To optimize for search engine bots as well as your readers, follow these best practices:

Include 1-2 keywords.

Make sure to include the keyword phrase you want to rank for in your slug. Both search engines and readers will look here to determine what the page or post is about. The general syntax should look like: websitename.com/topic-mentioned-here.

Match the title (but don’t replicate it).

You want a URL’s slug to closely match the title of the post or page. For example, if your post title is “Our Favorite Dachshund Puppy Photos”, and the URL slug is “how-to-get-cheap-plane-tickets”, bots and readers are going to be confused by the difference in content.

However, optimizing slugs isn’t as simple as copying and pasting the title of the post or page. Since the ideal length of titles is 60 characters or fewer, post titles are usually much longer than slugs should be. Titles also use spaces and title case, whereas slugs should use hyphens or underscores between words, and be all lowercase.

Remove unnecessary words.

You can make slugs more readable by omitting pronouns, articles, and prepositions. These are known as stop words and are generally ignored by search engines anyway. A good rule of thumb is if readers can fill in the gaps and make sense of the slug without certain words, you should omit them.

Now that we’ve covered these tips and techniques, let’s see some real ones. Here are some examples HubSpot blog post titles and their URL slugs:



25+ Best Blogging Tools to Grow Your Blog in 2020


The Anatomy of a Search-Friendly URL [Infographic]


Serverless Functions: Your Website's New Best Friend


9 Squarespace Alternatives & Why You Might Want Them


With these best practices in mind, let’s walk through the process of changing a URL slug in WordPress.

How to Change a URL Slug in WordPress

By default, WordPress uses the “plain” permalink structure, as shown below.

the wordpress permalinks page for changing permalink structure in wordpress

Because the plain structure does not contain keywords, it is not an SEO- friendly structure.

Changing this default permalink structure is an important step to make your WordPress blog SEO-friendly. You can do so by navigating to Settings > Permalinks and selecting another option. We recommend “Post name” because it is the shortest slug option while still including relevant keywords.

Note that it’s important to change your permalink settings before launching your website if possible. If you change your permalinks after your site goes live, you’ll have to set up redirects from your old URLs to your new ones. Fortunately, there are plenty of redirect WordPress plugins to simplify this process.

Once you receive a notification that your permalink structure has been updated successfully, you can edit the slugs of individual posts and pages on your site. Let’s walk through the process step by step.

1. Navigate to Posts > All Posts to edit an existing draft or Add New to create a new draft. You can follow these steps for Pages as well.

Navigate to Posts > All Posts to start process for changing URL  slug

2. If you navigated to All Posts, then scroll to the draft you want and click Edit.

Click edit to edit draft in WordPress to continue process for changing URL slug

3. On the right-hand side of the screen, click the optional control next to Permalinks to open the dropdown menu.

Clicking permalink dropdown menu in WordPress Gutenberg editor to change slug

4. Edit the slug, then click Save Draft in the toolbar at the top of the screen.

Click Save draft to complete process of changing URL slug

You can repeat this process for all your posts and pages moving forward. This ensures you’re creating SEO-friendly URLs that delight search engine bots and your site visitors.

WordPress Slugs: Don’t be slow to update them!

Clean URLs are one of those small details that distinguish novice website owners from experienced ones — not only are clear URLs better for your SEO, but they also make your website look more legitimate and give visitors a better idea of how your website is structured.

Changing your URL slug isn’t difficult, but it’s essential if you want a WordPress website that both humans and search engines will love.

Editor's note: This post was originally published in June 2020 and has been updated for comprehensiveness.

Use HubSpot tools on your WordPress website and connect the two platforms  without dealing with code. Click here to learn more.

Related Articles

Capture, organize, and engage web visitors with free forms, live chat, CRM, analytics, and more.