Publié le Mis à jour le 13 min de lecture

You have just published a new post on your WordPress site. You refined your title, wrote quality content, and added your images.

But have you looked at the URL that was generated automatically? In many cases, it looks something like this: “/what-is-a-slug-in-wordpress-and-how-to-optimize-it-for-seo”.

Or worse, like this: “/p=142”.

This is where the WordPress slug comes into play. The slug is one of those small technical details that is often overlooked, even though it plays a real role in your organic search visibility.

If poorly configured, it can hurt your visibility on Google. When well optimized, it makes your URLs more readable for your visitors and helps Google better understand the semantics and structure of your content (prerequisites for good rankings).

In this article, we explain what a slug is, why it matters for SEO, how to set it for your content, and above all how to make the most of it through simple and effective best practices.

What is a WordPress slug?

Slug is a term that comes from the English word “slug” and, in the context of the web, refers to the final part of a URL that identifies a specific resource (post, page, category, etc.) in a readable way.

In WordPress, the slug corresponds to the fragment of the web address that follows your domain name (and possibly your permalink structure).

A URL refers to the complete address of a unique resource on the internet (e.g.: www.votresite.fr/wordpress/referencement-seo). A domain name is the part of the URL that corresponds to your site’s name (e.g.: votresite.fr). It consists of a name (e.g.: votresite) and an extension (e.g.: .fr, .com, .eu, etc.).

To understand it properly, let’s take an example of a slug on WordPress. If the full address of one of your posts is: https://www.monsite.fr/blog/slug-wordpress

…then the slug is: slug-wordpress.

It is therefore a unique text identifier, generally made up of lowercase words separated by hyphens.

WordPress automatically generates it from the title of your content, but you can — and should — edit it manually to optimize it (we’ll come back to this later).

A slug applies to all types of content in WordPress:

  • Blog posts.
  • Pages.
  • Categories and tags.
  • Authors.
  • Custom content types (custom post types) created by your plugins or your theme, for example.
An example of a WordPress slug on a screen.

Now that you know more about our famous “slug” that trails along at the end of the URL, let’s take stock of a fairly common confusion.

Very often, a WordPress slug is confused with the term permalink. And actually, that’s entirely understandable. 

To shed some light on the subject and understand everything, discover the distinction to remember so you don’t make any more mistakes. 

A WordPress permalink refers to the link (permanent URL) of content published on your WordPress site.

It may be the address of a page, a post, a category, a WooCommerce product, etc.

According to the official WordPress documentation, the term permalink is a portmanteau meaning “permanent link” because it is meant to remain valid for a long time. In fact, it is the English contraction of “permanent link”.

This permalink includes: 

  • The protocol (https://).
  • The domain name.
  • The structure chosen in the WordPress settings.
  • And of course the slug itself!

To understand it all, take a look at this example of a complete permalink: https://www.monsite.fr/category/tutoriels/slug-wordpress

In this example, “tutoriels” is the category slug, and “slug-wordpress” is the post slug. Together, they form the permalink.

The permalink structure is configured in the Settings > Permalinks menu on your WordPress dashboard.

You can choose whether or not to include the date, the category, or only the post name. For SEO, the most recommended structure is the one that keeps only the post slug, without a date or numeric ID. In the WordPress settings, this corresponds to the “Post name” checkbox.

Permalink settings on WordPress.

In summary: the slug is a component of the permalink. You configure the permalink structure once and for all, and then optimize slugs on a case-by-case basis, content by content.

Why are WordPress slugs important for SEO?

A page’s URL is one of the signals Google takes into account to understand its content.

A well-constructed slug sends a clear relevance signal to search engines. A slug generated automatically from a long title can, on the other hand, harm readability and dilute that signal.

Among the main reasons why slugs have an impact on your WordPress SEO, we can highlight, for example: 

  • Including the main keyword. Google reads the URL to contextualize the content. A WordPress slug that contains your target keyword strengthens the semantic consistency of your page.
  • Readability for users. A short, explicit URL inspires trust. In search results (known as SERPs in the jargon), the URL appears under the page title. A clear slug improves the click-through rate.
  • Sharing and remembering. A clean URL is easier to copy, share on social media, or remember for returning directly to the site.
  • Avoiding duplicate content. Poorly managed slugs (duplicates, incorrectly encoded accented variations) can create URL duplication issues and harm the indexing of your content.

Note that the weight of URLs in Google’s algorithm is modest compared with factors such as content or backlinks (a link that another site points to yours).

But in a highly competitive SEO context, every signal counts. An optimized slug won’t do everything, but a neglected WordPress slug can create unnecessary obstacles to your ranking on search engines.

After this first theoretical section, let’s move on to practice just below.

How do you define a content slug?

WordPress automatically generates a slug as soon as you enter a title. It uses the title in lowercase, replaces spaces with hyphens, and removes certain special characters.

Small problem: the result is rarely optimal. The slug created by WordPress is often too long, contains unnecessary linking words (“and”, “of”, “for”, “the”), numbers, or poorly encoded characters from accents.

It is therefore important to define your slug manually as soon as the content is created. Let’s review how to proceed for several common content types.

For a post or a page

Most common case: creating a blog post. To do this, go to the Posts > Add New Post menu. 

Enter your content in the WordPress editor (at least the H1 title of your post), then click “Save draft”. 

The WordPress slug is edited in the right-hand sidebar, in the “Post” tab, under the “slug” label. 

By default, it uses the title of your post with the words separated by hyphens. Click on it to enter your custom slug directly.

Editing a WordPress slug in Gutenberg.

You want to work on a page. The logic and procedure are exactly the same as for a post. The only difference? Start by going to the Pages > Add New menu.

For a category or a tag

Now let’s move on to practical case no. 2: creating a slug on a category or tag page.

Go to Posts > Categories (or Tags). When creating or editing a taxonomy, a “Slug” field is available.

It is especially important to take care of it for categories, because they often appear in the URL of many posts.

To do this, use your category name in lowercase in your category’s WordPress slug box, without accents or special characters: 

Editing the WordPress slug of a category.

By the way, here’s a small practical tip you can apply to most SEO plugins (Yoast, Rank Math, SEOPress, All-in-One SEO).

If you do not want to display your category prefix in your URL (by default WordPress creates a “category” prefix), you can disable it using a checkbox in Yoast SEO under Taxonomies > Categories. 

You will then get a URL like votresite.fr/slug-wordpress/ instead of votresite.fr/category/slug-wordpress/.

Displaying the category prefix in the slug in Yoast SEO.

Whenever possible, avoid using tags, as they can cause duplicate content issues.

For an author profile

By default, an author’s slug corresponds to their username (“user_nicename” in the database).

Once created, you cannot change it natively in the Author profile (the “Accounts” menu in the WordPress back office). 

However, you can modify and optimize it using a plugin such as Edit Author Slug (provided the author has a user account). Once this plugin is activated, follow the steps below: 

  • Go to the Accounts > All Accounts menu.
  • Select the Author profile of your choice and click “Edit”.
  • In the “Edit Author Slug” section, enter the slug of your choice in the “Custom” checkbox field. Whenever possible, use a readable and professional identifier.
  • Click “Update Profile” to save the change.
Changing an author’s slug in WordPress.

How to modify and customize a slug in WordPress?

Modifying an existing slug is a simple operation, but it must be done with caution. Let’s now look at the two situations you may encounter.

Modify the WordPress slug of content that has not yet been published

This is the ideal case. As long as your content has not been indexed by Google, you can change its slug without risk.

All you need to do is follow the steps described in the previous section and save your changes before publishing.

Modify the slug of content that has already been published and indexed

Changing the slug of content that has been published and indexed by Google is done by modifying it as you saw earlier in this article.

By the way, on this topic, there’s a useful tip to know. You can quickly modify a slug in WordPress using the “Quick Edit” option available under each piece of content (post, page, etc.).

This is done in two steps: 

  1. In Posts > All Posts, click “Quick Edit” under the post of your choice.
  2. Enter the new slug of your choice, then select “Update”. 
Quickly editing a WordPress slug.

But be careful, big warning here! Changing the URL of a page that’s already indexed is a bit like moving house without leaving your forwarding address with the post office: your visitors and Google will end up on a non-existent page (404 error).

To avoid this, it is essential to set up a 301 redirect (permanent redirect) from the old URL to the new one (the one containing the modified slug). 

This redirect tells Google that the content has permanently changed address and allows it to transfer the SEO value accumulated by the old URL.

Good news: in recent versions of WordPress (6.5+), an automatic redirect is offered when a slug is modified. However, this native feature remains limited.

For precise and long-term management of your redirects, we recommend using a dedicated plugin, as we explain in the next section.

How do you manage redirects after modifying slugs?

Redirect management is an often-overlooked step, yet it is crucial for preserving your SEO.

A modified URL without a redirect creates a 404 error, which can lead to a loss of organic traffic and a degraded user experience.

Use a redirect plugin

The Redirection plugin is the go-to tool on WordPress for managing your 301 redirects. Free of charge, it allows you to:

  • manually create redirects to a new URL;
  • enable automatic detection of slug changes;
  • monitor 404 errors across your entire site;
  • view redirect logs to analyze visits.

To learn how to use it step by step, we refer you to our tutorial on WordPress redirection.

Other alternatives exist, such as Yoast SEO Premium (which includes a redirection module) or Rank Math, which also offers this feature in its free version.

Redirection via the .htaccess file

For advanced users, it is possible to add redirect rules directly in the .htaccess file, located at the root of your WordPress installation.

This is a more efficient method (it does not involve PHP), but also riskier if you are not comfortable with Apache syntax.

In any case, it is important to check that your redirects are working properly after they have been set up, using tools such as Screaming Frog, Google Search Console, or a simple online URL testing tool.

Best practices and tips for creating SEO-optimized WordPress slugs

By now, you know everything you need to know to create and modify a slug in WordPress. To be as comprehensive as possible on the subject, let’s finish with some 

essential recommendations to apply to create effective, readable, and SEO-friendly slugs: 

  1. Include your main keyword. The slug should contain the target keyword for your content. If you are writing an article about “WordPress slug”, your slug should be exactly: wordpress-slug. 
  2. Keep it short and precise. An ideal slug contains between 3 and 5 words. Avoid using your entire title. Remove articles, prepositions, and linking words that add no semantic value (“and”, “of”, “the”, “for”, “in”, etc.).
  3. Use hyphens, not underscores. Search engines, and Google in particular, interpret the hyphen (-) as a word separator. The underscore (_) is considered a linking character. Always use hyphens between the words in your slug.
  4. Avoid accents and special characters. Accents (é, è, à, ü…) and special characters can be incorrectly encoded in URLs, generating unreadable sequences such as “%C3%A9”. WordPress generally handles this conversion well, but for greater safety and better readability, write your slugs without accents.
  5. Use lowercase only. By convention and to avoid URL duplication issues (some servers distinguish between uppercase and lowercase), always write your slugs entirely in lowercase.
  6. Do not change slugs without a valid reason. Another important point: a well-ranking slug should not be changed without a serious reason. If your URL generates organic traffic, changing it carries a risk, even with a redirect. Reserve changes for truly problematic slugs or those that have never been indexed.
  7. Adapt your slug structure to your site architecture. If your site is organized into thematic silos, your slugs and permalink structure should reflect this. This consistency makes it easier for Google to understand your architecture and improves internal linking.
  8. Set up a redirect if you encounter a broken link after changing a slug.

At first glance, the WordPress slug is just a simple technical detail at the end of a URL. However, as you have seen throughout this article, it plays a far more strategic role than it may seem.

A clear, short, and optimized slug helps improve the readability of your URLs, strengthen Google’s understanding of your content, and provide a better experience for your visitors.

Conversely, a poorly configured WordPress slug can make it harder for your pages to be indexed, generate errors, or weaken your visibility in search results.

Of course, slug optimization is only one piece of the SEO puzzle. Permalink structure, internal linking, redirect management, technical site performance: all these elements work together to contribute to the success of a WordPress site.

If you want to go further and ensure that your site is built on solid technical foundations, the Maintenance WP agency can support you.

Our team specializes in WordPress website development, technical maintenance and organic SEO, in order to sustainably optimize your site’s visibility and performance.

Need an expert review of your SEO or URL structure? Contact Maintenance WP and turn every technical detail—including your slug—into a real growth driver for your site.

Découvrez plus de contenus

fleche separateur

Voir plus d’articles