Skip to content

What Are Permalinks in WordPress? The Best Structure for SEO

Key Takeaways

  • WordPress sets permalinks in Settings > Permalinks, and changing the structure on a site with published posts re-generates every URL at once.
  • Plain uses /?p=N by default, while Post name uses /post-name/ and is the best SEO choice for most sites.
  • WordPress supports six permalink settings, including Day and name, Month and name, Numeric, Post name, and Custom Structure.
  • Custom Structure uses tags such as %year%, %monthnum%, %postname%, tegory%, and %author%, and WordPress says the structure should end with either %post_id% or %postname%.
  • Changing one post's slug triggers wp_check_for_changed_slugs() and wp_old_slug_redirect(), but changing the site-wide permalink structure does not, so 301 redirects are required to protect rankings.

Permalinks are the one WordPress setting that looks harmless and is not. Most settings you can change on a Tuesday afternoon and nobody notices. Change your permalink structure on a site with three years of published posts and you can break every URL Google has indexed, every link anyone has ever shared, and every internal link in your own archive, all from a single click on a settings page.

The WordPress documentation is blunt about this. Permalinks, it says, “are permanent and should never be changed.”

Which makes it worth getting right the first time. This guide covers what a permalink actually is, what every structure tag does, which structure to use for SEO and why, and how to change one on an established site without losing your rankings.

Table of Contents

What a Permalink Actually Is

A permalink is the permanent URL of a single piece of content on your site. Not the address of your homepage, and not a temporary link. It is the one address that should still resolve to the same post in five years.

WordPress builds that URL for you out of a pattern you choose once, in Settings > Permalinks. You are not naming each post’s URL by hand. You are picking a template, and WordPress fills it in for every post you publish from then on.

That distinction matters because it explains why changing the setting is disruptive. You are not editing one URL. You are re-generating every URL on the site at once.

The Three Types of WordPress Permalink

WordPress documents three categories, and the names are worth knowing because support threads use them constantly.

  • Plain (also called “ugly”): http://example.com/?p=N, where N is the post’s database ID. This is what a fresh WordPress install uses by default. The documentation describes it as “not user-friendly and also not optimized for search engines.”
  • Pretty: the readable kind, such as http://example.com/2012/post-name/. This is what you want.
  • Almost Pretty: identical to pretty, but with /index.php in front, like http://example.com/index.php/yyyy/mm/dd/post-name/. You only need this if your server cannot handle proper URL rewriting.

One practical note that catches people out on cheap hosting: pretty permalinks depend on your web server being configured for them. WordPress notes that your host “should have set up the web servers with the necessary configurations” for pretty permalinks to work, and that if they have not, you need to contact them. If you switch to a pretty structure and your whole site 404s, this is usually why, not WordPress itself.

The Six Permalink Settings, Decoded

Settings > Permalinks gives you six choices. Here is what each one produces and who it actually suits.

SettingWhat the URL looks likeBest for
Plain/?p=123Nobody, in practice. It is only the default because it works on every server.
Day and name/2026/08/11/post-name/News sites and publications where the exact date is part of the story.
Month and name/2026/08/post-name/Publications that want a date signal but shorter URLs.
Numeric/archives/123Effectively nobody. It uses the post’s database ID, so the URL says nothing.
Post name/post-name/Most sites. Blogs, business sites, documentation, evergreen content.
Custom StructureWhatever you defineSites that need a prefix, such as /blog/%postname%/.

The default on a new install is Plain. That is a compatibility decision, not a recommendation, and changing it is usually the first thing you should do on a new site, while changing it costs you nothing.

Every Structure Tag WordPress Supports

If you pick Custom Structure, you build the pattern from these tags. This is the complete list WordPress provides.

TagWhat it insertsExample
%year%Year of publication, four digits2018
%monthnum%Month, two digits05
%day%Day, two digits28
%hour%Hour of publication15
%minute%Minute of publication43
%second%Second of publication33
%post_id%The post’s unique database ID423
%postname%Sanitized version of the post title (the slug field)this-is-a-great-post
%category%Sanitized category name; nested categories become nested folderstutorials/wordpress
%author%Sanitized post author namejane-doe

Two rules from the documentation are easy to miss and expensive to get wrong. First, you do not put your domain in the field, only the tags. Second, and more important, you should end your structure with either %post_id% or %postname% so WordPress can identify an individual post from the URL. A structure that ends in %category% or %year% gives WordPress no way to tell which post you meant.

Which Permalink Structure to Use for SEO

For most sites the answer is /%postname%/, set via the Post name option.

It produces short URLs, it puts real descriptive words in the address, and it does not embed a date that makes a perfectly current article look stale two years later. That last point is the one people underrate. A URL containing /2024/ tells every reader, and arguably Google, that your content is from 2024, even after you have rewritten it top to bottom.

There are honest exceptions:

  • News and time-sensitive publishing. If you publish multiple pieces a day and the date is genuinely part of the meaning, Day and name earns its place, and it neatly prevents slug collisions between similar headlines.
  • Very large archives. A date segment gives you natural grouping when you have tens of thousands of posts.
  • Sites that need a content prefix. If your blog lives under /blog/, use a custom structure of /blog/%postname%/. This is the pattern this site uses.

About That “%postname% Hurts Performance” Warning

You will still find advice saying a permalink structure that starts with %postname% or %category% puts extra load on your server, and that you should prefix it with a numeric tag to keep things fast. That claim traces back to old WordPress Codex guidance.

Here is what is verifiable today. The current WordPress permalink documentation, last updated in June 2025, contains no performance warning of any kind about structures beginning with %postname%, %category%, or %author%. The guidance is simply not there anymore.

So do not contort a perfectly good URL structure around a warning that current WordPress documentation no longer makes. Pick the structure that serves your readers.

What Google Actually Says About URLs

Google publishes specific URL structure guidance, and it is shorter and less dramatic than most SEO advice about it. The recommendations that apply directly to your permalink settings:

  • Use words, not IDs. Google recommends you “use readable words rather than long ID numbers in your URLs.” This is the single strongest argument against the Plain and Numeric settings.
  • Hyphens, not underscores. Google recommends “using hyphens (-) instead of underscores (_) to separate words in your URLs, as it helps users and search engines better identify concepts.” WordPress already does this when it generates a slug from your title, so you get it for free.
  • Use your audience’s language. Google advises using “words in your audience’s language in the URL,” including transliterated words where relevant.
  • Keep casing consistent. URLs are case sensitive, so Google suggests converting text to the same case so it can tell that URLs point to the same page.

Worth being straight about one thing: Google’s URL structure documentation does not claim that URL structure is a ranking factor. It frames the guidance around crawlability and usability. A clean permalink will not outrank a better article. It removes friction, and that is the honest size of the win.

The %category% Trap Most Guides Skip

Putting %category% in your permalink looks tidy. It creates URLs like /tutorials/how-to-do-a-thing/ that mirror your site’s organization. There are two catches.

First, a post can belong to several categories, but only one can appear in the URL. WordPress documents how it decides: when multiple categories are assigned, the one that shows up in the permalink “is determined alphabetically.” So a post filed under both Analytics and WordPress lands at /analytics/, whether or not that is the category you would have chosen. You can override this with a plugin, but out of the box it is alphabetical and silent.

Second, recategorizing a post changes its URL. A tidying session in the admin becomes an accidental site migration.

Separately, on the same settings screen you can customize the Category base and Tag base, the prefixes in archive URLs that default to category and tag. You can rename them. What you cannot do, per the documentation, is remove them from the URLs altogether without help from a plugin.

How to Change Permalinks Without Losing Rankings

This is where the real damage happens, and where a widely repeated half-truth causes it.

You will read that WordPress automatically redirects your old URLs, so changing permalinks is safe. That is true in one specific case and false in the other, and the difference is everything.

What WordPress Handles For You

When you change the slug of one published post, WordPress core has your back. The function wp_check_for_changed_slugs() saves the previous slug into post meta under the key _wp_old_slug. Its documentation states the purpose plainly: the function exists for “redirecting changed post objects,” so that anyone who linked to the old address lands on the new one. A companion function, wp_old_slug_redirect(), runs on the template_redirect hook and sends visitors from the old slug to the current one.

So renaming a single post’s slug is genuinely low risk. One documented limitation: this does not apply to hierarchical post types, which is why pages behave differently from posts.

What WordPress Does Not Handle

Changing the site-wide permalink structure is a different operation, and core’s old-slug mechanism does not cover it. The slugs did not change. The pattern around them did.

This is not a matter of interpretation, it follows from how the mechanism works. The redirect operates by matching a stored _wp_old_slug value, and that value is only written when a post’s slug changes. Change the structure instead and no slug ever changed, so there is nothing stored to match against and nothing to redirect to.

Practically: switch from Day and name to Post name on a site with 400 posts and you have just created 400 URLs that return a 404, every one of them potentially carrying links and rankings.

The Safe Way to Do It

  1. Export your current URLs first. Before touching the setting, get a full list of live URLs from your sitemap or an analytics export. You cannot redirect what you did not record.
  2. Change the structure. Settings > Permalinks, choose the new option, save.
  3. Set up 301 redirects from every old URL to its new one. A 301 is the permanent redirect that passes ranking signals to the new address. This is the step that actually protects you, and it is not optional.
  4. Watch your 404 log for weeks, not days. Some URLs only surface when a crawler or an old inbound link finds them.
Google Search Central documentation explaining 301 permanent redirects
Google’s own documentation on 301 permanent redirects, the mechanism that carries ranking signals from an old URL to a new one.

If you would rather not add another plugin for this, Nexter Extension includes a built-in SEO toolkit that covers redirects and a 404 monitor alongside meta, schema, and XML sitemaps. That pairing matters here specifically, because a permalink change is exactly the situation where you want the redirect tool and the 404 log in the same place.

Nexter SEO redirect manager creating a 301 redirect inside the WordPress admin
The redirect manager in Nexter’s built-in SEO toolkit, where old permalinks are mapped to their new addresses.

When Permalinks Stop Working

A specific and common failure: your homepage loads fine, but every individual post returns a 404. Nothing is lost. WordPress has simply lost the rewrite rules that map pretty URLs to content.

Work through this in order.

  1. Re-save your permalink settings. Go to Settings > Permalinks and click Save Changes without changing anything. This forces WordPress to regenerate its rewrite rules and fixes this more often than any other single step.
  2. Check your server configuration. Pretty permalinks need the server set up for URL rewriting. WordPress explicitly points at your hosting provider for this. If step one did not work and the site recently moved hosts, this is the likely cause.
  3. Deactivate plugins temporarily. Anything that registers custom post types, custom taxonomies, or its own redirects can conflict over rewrite rules.
  4. Switch to a default theme. Rare, but a theme registering rewrite rules badly can produce the same symptom.

While you are diagnosing, a custom 404 page keeps visitors who hit a broken URL moving toward working content instead of leaving.

The Short Version

Set your permalinks to Post name on day one, add a /blog/ prefix if your site structure calls for it, and then leave the setting alone. Keep slugs short and descriptive, let WordPress handle the hyphens, and skip the year unless you are running a news site.

If you inherit a site on the wrong structure, changing it is a redirect project, not a settings change. Treat it that way and you keep your rankings. Treat it as a single click and you will spend the next quarter chasing 404s.

Suggested Reading

Stay updated with Helpful WordPress Tips, Insider Insights, and Exclusive Updates – Subscribe now to keep up with Everything Happening on WordPress!

Have Feedback or Questions?

Join our WordPress Community on Facebook!