Table of contents
Get the industry’s fastest hosting for WordPress◦ 99.999% uptime
◦ Comprehensive security
◦ 24/7 support

WordPress GuideBuild → Slug

What is a WordPress slug?

slug in wordpress

When you create a page, post, or category in WordPress, you’ll notice the URL often includes a short, editable string of text at the end. That’s the slug—and it plays a bigger role in your site’s usability and SEO than you might think.

Get fast, reliable hosting for WordPress

Power your site with the industry’s fastest, most optimized WordPress hosting

What is a slug?

In WordPress (or any site, really), a slug is the part of a URL that identifies a specific post, page, category, or tag in a readable way. For example, in the URL yourwebsite.com/about-us, the slug is about-us.

WordPress automatically generates slugs based on the title of your content, but you can edit them to make them shorter, cleaner, and more search-friendly. Slugs should avoid spaces, capital letters, and special characters, relying instead on lowercase letters and hyphens to keep URLs simple and user-friendly.

Why slugs are important

Slugs help search engines understand what a page is about, which can improve your SEO rankings. 

A clear slug also makes your links easier for users to read and remember. For example, yourwebsite.com/wordpress-slug is much more descriptive than yourwebsite.com/?p=123.

Slugs also give you control over how your content is displayed in search results and when shared on social media, making them an essential part of site optimization.

How slugs work in WordPress

When you publish content, WordPress uses the slug to generate the permalink (the full URL). For example, if your site is yourwebsite.com and your post title is “How to Bake Bread,” WordPress might create the URL yourwebsite.com/how-to-bake-bread/. The how-to-bake-bread portion is the slug.

If you edit the slug, WordPress automatically updates the URL to reflect the new version. That’s why slugs should be chosen carefully before publishing—changing them later can break existing links unless you set up redirects.

How to edit a slug in WordPress

You can change a slug directly from the editor. Here’s how:

Image

How to optimize a slug in WordPress

Well-optimized slugs can improve both SEO and user experience. Here are a few best practices:

How to set category slugs in WordPress

Categories also have slugs, which appear in URLs for category archives. To edit them:

For example, if your category is “Recipes,” you might want the slug to be simply recipes so URLs look like yourwebsite.com/category/recipes/.

How to set author slugs in WordPress

Author pages in WordPress also use slugs. By default, WordPress assigns the username as the slug, but you can change it with the help of a plugin like Edit Author Slug. Here’s how:

This makes your author archive URL look cleaner, such as yourwebsite.com/author/john-doe/.

WordPress slug FAQs

A common example is when you publish a page called “Contact Us.” WordPress will automatically create the slug contact-us, so your URL might look like yourwebsite.com/contact-us/.

A slug is simply the part of a URL that comes after your domain. For example, in example.com/blog/best-coffee, the slug is best-coffee.

On any website, a slug is the user-friendly, readable portion of a URL that identifies a specific page or piece of content. It replaces long ID numbers or technical strings with something simple and descriptive.

You use slugs in WordPress by editing them in the page, post, category, or tag settings. Choose short, keyword-rich, hyphenated text that accurately describes the content. Well-optimized slugs help with SEO and make URLs easier for users to understand and share.

Additional resources

How to build a WordPress site →

A complete beginner’s guide that covers 9 key steps to a successful launch

Website builders vs. WordPress →

With website builders and WordPress at your disposal, you don’t need to expend your energy or savings to build a website that suits your brand.

How to use WordPress Gutenberg blocks →

A complete beginner’s guide to Gutenberg blocks