◦ Comprehensive security
◦ 24/7 support
WordPress Guide → Build → Slug
What is a WordPress slug?
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:
- Open the page or post you want to edit in the WordPress editor.
- Look at the “Permalink” or “URL” settings in the sidebar.
- Click inside the slug field and type your preferred version.
- Make sure to use lowercase letters and hyphens instead of spaces.
- Update or publish the page to save your changes.
How to optimize a slug in WordPress
Well-optimized slugs can improve both SEO and user experience. Here are a few best practices:
- Keep it short: Use only the essential words. For example, wordpress-slug is better than what-is-a-slug-in-wordpress-and-how-to-use-it.
- Use keywords: Include your main target keyword naturally.
- Avoid filler words: Skip words like “the,” “and,” or “of” unless they’re necessary.
- Use hyphens, not underscores: Hyphens are the web standard for separating words.
- Match content: Make sure the slug reflects the content accurately so users know what to expect.
WordPress slugs vs permalinks
The slug is just one part of the permalink. The permalink is the entire URL, while the slug is the customizable piece at the end. For example:
- Permalink: yourwebsite.com/blog/what-is-a-slug
- Slug: what-is-a-slug
Permalinks can also include category names, dates, or author information, depending on your WordPress settings. The slug is where you have the most control over clarity and SEO value.
How to set category slugs in WordPress
Categories also have slugs, which appear in URLs for category archives. To edit them:
- Go to Posts > Categories in your WordPress dashboard.
- Hover over a category and click Edit.
- Update the slug field with your preferred text.
- Save changes.
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:
- Install and activate the Edit Author Slug plugin.
- Go to Users > All Users and select the user you want to edit.
- Scroll down to the “Edit Author Slug” section.
- Enter your preferred slug (for example, john-doe).
- Save changes.
This makes your author archive URL look cleaner, such as yourwebsite.com/author/john-doe/.
WordPress slug FAQs
Getting started with WordPress slugs
Ready to take the training wheels off your WordPress site? Upgrade to professional hosting and see how better speeds, security, and reliability provide a foundation for a website and a brand that people find engaging and trustworthy. Liquid Web’s WordPress hosting options configure business-class servers and support plans specifically for WordPress websites.
Don’t want to deal with server management and maintenance? Our fully managed WordPress hosting is the best in the industry. Our team are not only server IT experts, but WordPress hosting experts as well. Your server couldn’t be in better hands.
You can avoid site speed problems when you’re with Nexcess Fully Managed WordPress or Liquid Web’s suite of WordPress hosting solutions.
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