A clear URL tells both people and search engines what a page is about before they open it. example.com/install-nginx-ubuntu/ beats example.com/?p=123 every time. WordPress makes this easy, but there are a few decisions to get right — especially changing URLs on an existing site.
Pick a permalink structure
Go to Settings → Permalinks. The common choices:
| Structure | Example | When to use |
|---|---|---|
| Post name | /install-nginx-ubuntu/ |
Best default for most sites |
| Category + post name | /linux/install-nginx-ubuntu/ |
Large sites with stable categories |
| Day and name | /2026/11/04/install-nginx-ubuntu/ |
News sites where the date matters |
| Plain | /?p=123 |
Never for public sites |
Post name (/%postname%/) is short, readable and doesn’t change when you recategorize a post. Dates in URLs make evergreen content look stale.
Write good slugs
- Short and descriptive:
wordpress-backup-plugins, notthe-10-best-wordpress-backup-plugins-you-should-use-this-year. - Lowercase, words separated by hyphens.
- No years unless the content is truly tied to one (“2026” in the slug forces a URL change next year).
- Remove stop words when they add nothing (
a,the,and). - Avoid duplicates — WordPress appends
-2to a slug that already exists. That’s a sign of duplicate content you should consolidate.
You can edit the slug in the post editor sidebar (URL field) before publishing.
Changing URLs on a live site
Changing the structure or slugs on an established site resets ranking signals unless you redirect:
- Map old to new URLs — export your post list before the change.
- Add 301 redirects for every changed URL. WordPress redirects some changed post slugs automatically (it stores the old slug), but not structure changes. Use a redirect plugin (e.g. Redirection) or server rules.
- Update internal links so they point to the new URLs directly.
- Submit the new sitemap in Google Search Console and watch the Pages report for 404s.
Server-level redirects in Nginx are fast and don’t depend on PHP:
location = /old-post-name/ { return 301 /new-post-name/; }
Make pretty permalinks work on your server
If pretty URLs return 404 errors, the web server isn’t passing requests to WordPress.
Nginx — the site’s location / block needs:
location / {
try_files $uri $uri/ /index.php?$args;
}
Apache — enable mod_rewrite and allow .htaccess overrides:
a2enmod rewrite
# In the site's <Directory> block: AllowOverride All
systemctl reload apache2
WordPress writes the needed rules into .htaccess when you save the Permalinks page.
Trailing slashes and canonical URLs
Pick one form (WordPress uses a trailing slash by default) and stick with it. WordPress redirects the other form automatically. Your SEO plugin adds a <link rel="canonical"> tag so search engines consolidate signals on one URL — check that it matches the address in the browser bar.
Summary
Use /%postname%/, keep slugs short and timeless, and always 301-redirect when URLs change. If you host WordPress yourself, make sure Nginx or Apache passes requests to index.php — our LAMP stack guide and WordPress VPS page cover the server side.