Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Improve Your WordPress URL Slugs

A clean web address is easier to read and share. This guide shows how to set tidy slugs on your WordPress site, and what to do in cPanel if it goes wrong.

Website Management2 min read14 steps4 screenshots

What is a URL slug?

A URL is a web address. The slug is the last part that names one page. In yourdomain.com/best-pizza-recipe, the slug is best-pizza-recipe. Compare it with yourdomain.com/?p=123. The first one tells people and search engines what the page is about. The second tells nothing.

A permalink is the full permanent address of a page. WordPress lets you pick its shape.

Warning: Changing the shape on an old site changes old addresses. Visitors and search engines may land on a "not found" page. Take a backup first, and add redirects if your site is already live.
  1. Log in to your WordPress dashboard.
  2. Click Settings, then Permalinks.
  3. Choose Post name.
  4. Click Save Changes.

Step 2: Write a good slug

  1. Open a post or page in the editor.
  2. In the side panel, find Permalink or URL.
  3. Edit the slug.
  4. Click Update.

Good slug rules:

  • Keep it short. Three to five words is plenty.
  • Use lowercase letters.
  • Use hyphens between words, not spaces or underscores.
  • Include the main keyword, which is the word people search for.
  • Remove small filler words such as "the" and "of".

If every page except the home page shows "404 Not Found" after you save, the .htaccess file may be missing or damaged. This file holds rules for the web server.

  1. Log in to cPanel and open File Manager.
    Screenshot: Log in to cPanel and open File Manager .
    Screenshot: Log in to cPanel and open File Manager .
  2. Click Settings and tick Show Hidden Files (dotfiles).
  3. Open public_html and find .htaccess. Download a copy first.
  4. Rename the file to .htaccess-old.
  5. Go back to Settings, then Permalinks in WordPress and click Save Changes. WordPress writes a fresh file.
    Screenshot: Go back to Settings , then Permalinks in WordPress and click Save Changes . WordPress writ
    Screenshot: Go back to Settings , then Permalinks in WordPress and click Save Changes . WordPress writ
  6. Test your pages.

Redirects for old addresses

A redirect sends visitors from an old address to a new one. Use a redirect plugin or the Redirects tool in cPanel to point old slugs to new slugs.

Quick recap

  • A slug is the end part of a page address.
  • Choose Post name under Settings then Permalinks.
  • Keep slugs short, lowercase and hyphenated.
  • Rebuild .htaccess if pages show 404.
  • Back up and add redirects on live sites.