← Back to all tutorials

Changing the Permalink Structure

Configure WordPress URL structure (permalinks) for clean, SEO-friendly URLs.

Changing the Permalink Structure

By default, WordPress URLs look like ?p=123. We need to change them to clean, readable, SEO-friendly URLs.

What Are Permalinks?

Permalinks are the permanent URLs to your individual posts, pages, and other content. The permalink structure determines how WordPress generates these URLs.

Default vs Clean URLs

StructureExample URLSEO
Plain (default)?p=123❌ Bad
Day and name/2025/03/10/my-post/⚠️ Okay
Month and name/2025/03/my-post/⚠️ Okay
Post name/my-post/✅ Best
Custom/blog/%postname%/✅ Good

How to Change the Permalink Structure

  1. Go to Settings → Permalinks
  2. Select "Post name" — this gives clean URLs like /my-post/
  3. Click "Save Changes"

WordPress will update Apache's .htaccess file automatically to handle URL rewriting.

Available Permalink Tags

TagWhat It Outputs
%postname%The post slug (e.g., my-first-post)
%year%Four-digit year (2025)
%monthnum%Month (03)
%day%Day (10)
%category%Post category slug
%author%Author name slug
%post_id%Numeric post ID

Custom Structure Examples

/%postname%/                  →  /my-post/
/blog/%postname%/             →  /blog/my-post/
/%category%/%postname%/       →  /javascript/my-post/
/%year%/%postname%/           →  /2025/my-post/

Why "Post Name" is Best

  • Shortest and cleanest — no unnecessary date or category info
  • SEO-friendly — search engines prefer descriptive, concise URLs
  • Future-proof — won't break if you change categories or dates
  • User-friendly — easy to read, remember, and share

Troubleshooting

  • 404 errors after changing permalinks? WAMP's Apache mod_rewrite module might be disabled. Click the WAMP icon → Apache → Apache Modules → check rewrite_module.
  • .htaccess not writable? WordPress needs write access to the .htaccess file in your site's root directory.

Key Takeaways

  • Change permalinks to "Post name" for the cleanest, most SEO-friendly URLs
  • Do this before creating content — changing permalinks later can break existing links
  • WordPress uses .htaccess for URL rewriting on Apache servers
  • Enable rewrite_module in WAMP if you get 404 errors