Originally published on CodingCush.
A WordPress permalink is the permanent web address of a single post or page, and the best permalink structure for SEO is "Post name", which gives you a short, readable address like example.com/wordpress-permalinks-explained/. In this guide you will learn what permalinks are, how the six built-in structures compare, which one to pick, and how to change yours safely.
What Is a Permalink in WordPress?
Permalink is short for "permanent link". Every post, page and category has one, meant to stay the same for the life of that content. When someone bookmarks your post or Google indexes it, they use this address, so a clear permalink says what the page is about before anyone opens it.
The same post, two structures:
Before (Plain): https://example.com/?p=123
After (Post name): https://example.com/wordpress-permalinks-explained/
The first says nothing: 123 could be a recipe or a tax guide. The second states the topic, is easy to share, and holds your keyword, a small SEO bonus. The official WordPress guide to permalinks says the same: your chosen structure decides how those permanent URLs look.
Each address has two parts: the structure from Settings, and the post slug, the editable tail.
The Six Permalink Structures Compared
WordPress ships with five ready-made structures plus a custom option, shown here for a post published on 24 November 2026:
| Structure | Example URL | Pros and cons |
|---|---|---|
| Plain | example.com/?p=123 | Always works, but bad for SEO. |
| Day and name | example.com/2026/11/24/wordpress-permalinks-explained/ | Good for news; dates age evergreen posts. |
| Month and name | example.com/2026/11/wordpress-permalinks-explained/ | Shorter, same ageing problem. |
| Numeric | example.com/archives/123 | Short, but says nothing about the topic. |
| Post name | example.com/wordpress-permalinks-explained/ | Short, readable, keyword rich. |
| Custom structure | example.com/blog/%postname%/ | Full control, like a /blog/ prefix. |
The pattern is clear: structures with the post name help readers and search engines, while number or date only structures hide it. Plain and Numeric throw away the free keyword. Date based structures suit news, but for tutorials they work against you: a reader who sees 2021 in the address may assume the guide is out of date before reading a word.
Which Permalink Structure Is Best for SEO?
For most sites, choose "Post name": short, keyword rich, never stale. Google has long said simple, readable URLs help search engines and users, and Post name is the simplest structure that still describes the page.
A custom structure is worth it in two cases only: sections you want visible in the address, like /blog/%postname%/, and news sites, where /%year%/%monthnum%/%postname%/ shows how fresh a story is. Otherwise, extra tags are just characters to ignore. Our WordPress vs Shopify comparison for online stores covers the trade offs.
Pick it once and stick with it: changing later means redirecting every old address.
The WordPress.org "Using Permalinks" support article.
How to Change Your Permalinks Safely
Step 1: Back up your site. Take a full backup, files plus database: a permalink change touches every address on your site.
Step 2: Open Settings, then Permalinks. In your dashboard, go to Settings, then Permalinks. You will see the six structures as radio buttons, with the custom field at the bottom.
Step 3: Pick your structure and save twice. Select "Post name" and click Save Changes twice. The second save flushes the rewrite rules, the step that stops 404 errors after a change.
Step 4: Check your key pages. Open your homepage, a few posts and a category page. If they load, the new structure is live. If posts show a 404 page, save again and read the troubleshooting section.
Step 5: Redirect old addresses. If your site was already live, every old address now points nowhere. Set up 301 redirects from each old URL to its new one, with a redirection plugin or server rules. A 301 tells Google the move is permanent, so your rankings travel with the page.
One technical note: on Apache, WordPress writes the new rewrite rules into .htaccess when you save. If it is not writable, WordPress shows the rules on screen for you to paste in. On Nginx there is no .htaccess file, so the rules go into your server block, and your host can add them.
Code Example: A Custom Post Type with Its Own Rewrite Slug
The structure above covers normal posts, but what about a custom post type, like "Books"? By default, a type called book gets URLs like example.com/book/the-wordpress-handbook/. The rewrite argument in register_post_type() lets you change that middle word to books.
Put it in your child theme's functions.php or a small custom plugin:
function cc_register_book_post_type() {
register_post_type( 'book', array(
'public' => true,
'label' => 'Books',
'rewrite' => array( 'slug' => 'books' ),
) );
}
add_action( 'init', 'cc_register_book_post_type' );
What it does: register_post_type() creates the "book" post type, and rewrite tells WordPress to use books as the URL base instead of book. Why it works: the rewrite slug is the piece WordPress slots between your domain and the post slug, exactly like "Post name" does for normal posts. When to use it: whenever a custom post type needs a plural or keyword rich base word, like /books/ or /courses/. After adding it, visit Settings, then Permalinks, and click Save Changes twice, so WordPress rebuilds its rewrite rules.
The hook at the end, add_action( 'init', ... ), runs your function at the right moment. If hooks are new to you, read our guide to the difference between action hooks and filter hooks in WordPress first. WordPress also has a post_link filter that can rewrite one post URL on the fly, but the rewrite slug is the normal route: it sets the pattern once, for every post of that type. The WordPress.com support page on permalinks and slugs shows the same idea from the dashboard side.
Tested output from a small PHP demo of the same logic:
Post name structure: https://example.com/wordpress-permalinks-explained/
Custom post type URL: https://example.com/books/the-wordpress-handbook/
PASS: post URL matches expected
PASS: book URL matches expected
Plain structure: https://example.com/?p=123
The demo builds both addresses the same way WordPress does. The full script is saved with this post and ran clean on PHP 8.3.32.
Common Mistakes and Troubleshooting
Getting 404 errors after changing permalinks. Go back to Settings, then Permalinks, and click Save Changes twice: that fixes it most of the time. If the errors stay, check that .htaccess is writable and holds the WordPress rewrite block, or ask your host to add the Nginx rules. If you see a blank page instead of a 404, suspect a plugin conflict and work through our guide to common WordPress errors explained, deactivating plugins one by one.
Forgetting to redirect old URLs. A structure change moves every address, so without 301 redirects, visitors and Google land on 404 pages and your old rankings fade.
Using the category base badly. Category pages live at example.com/category/news/. You can remove the /category/ part in settings, but it can clash with a page or post sharing the same slug, so only do it if no clash exists.
Mixing up trailing slashes. WordPress adds a trailing slash to Post name URLs, like /my-post/. Links without it usually still redirect, but mixed links look sloppy, so use the slashed version everywhere.
Editing a published post slug without a redirect. The slug is editable any time, but changing it on a live post moves the address and breaks every link to the old one, so add a 301 redirect the same day.
Frequently Asked Questions
What is the best permalink structure for WordPress SEO?
Post name: short, readable, keyword rich and never stale, which is why it is the standard recommendation for blogs, business sites and portfolios.
Will changing permalinks hurt my SEO?
Only if you skip the redirects. With a 301 redirect from every old URL to its new one, Google follows the move and your rankings travel with the page. Without them, the old pages return 404s and the rankings are lost.
Why do I get a 404 error after changing permalinks?
WordPress did not flush its rewrite rules, so go to Settings, then Permalinks, and click Save Changes twice. If that fails, check .htaccess on Apache, or ask your host to update the Nginx rules.
Should I include the date in my permalinks?
Only for news sites, where the date is part of the story. For tutorials and evergreen posts, leave it out: a date in the URL makes good content look old before anyone reads it.
Can I change the slug of a single post?
Yes. Edit the post, find the slug field, type a short lowercase slug with hyphens, and save. On a published post, add a 301 redirect from the old slug too.
Conclusion
Permalinks are a small setting with a long memory. Pick "Post name", keep slugs short, save twice after any change, and redirect every old address you leave behind. Do that once, and your URLs will keep working for years.

Top comments (0)