WordPress Permalinks: Best URL Structures for SEO Performance

Post name is the best WordPress permalink structure for most sites. This guide covers when a category or date fits, what each structure tag does and how to change permalinks on a live site with redirects.

A WordPress permalink structure looks like a 10-second setting, and on a new site it is. On a live site, the same setting changes the address of every post you have published.

If that change goes out without a plan, old links, bookmarks and Google results start landing on 404 pages. WordPress forwards a few kinds of old URL by itself, and it leaves the most common ones broken.

Our advice is simple. We'd use Post name on almost every site, and add a category or a date to the URL in only 2 cases. On a site that already has traffic, we'd change the structure only after the redirect rule is written and tested.

WordPress gives you 6 options under Settings > Permalinks. Post name is the right choice for most blogs, business sites and stores, because the URL stays short and stays valid when the post changes.

Option

Example URL

When we'd use it

Plain

example.com/?p=123

Only when the server can't rewrite URLs at all

Day and name

example.com/2026/05/09/sample-post/

News sites that publish many dated stories a day

Month and name

example.com/2026/05/sample-post/

Dated publications that readers browse by month

Numeric

example.com/archives/123

Almost never, because the number tells a reader nothing

Post name

example.com/sample-post/

Most sites: blogs, business sites, stores and portfolios

Custom structure

example.com/guides/sample-post/

Large sites with fixed sections, or a /blog/ prefix

These are the 3 structures worth choosing between, and the condition that decides each one:

  • Post name (/%postname%/): our default. You can update the post, change its date or move it to another category, and the URL doesn't move.
  • Category and post name (/%category%/%postname%/): this fits a large site whose sections are settled, such as a recipe site with a desserts section. Moving a post to another category changes its URL, so we'd avoid it on a site that is still finding its shape.
  • A dated structure: this fits a news site, where the publication date is part of what the reader wants to see. On a tutorial you update every year, the date in the URL makes a current guide look old.

Plain and Numeric should be skipped on any server that supports rewriting. Google's URL structure guidelines recommend readable words in a URL in place of long ID numbers.

How Much the URL Matters for SEO

The URL matters less for rankings than most permalink advice claims. Google's SEO Starter Guide says keywords in the domain or URL path "alone have hardly any effect beyond appearing in breadcrumbs."

So a cleaner structure won't lift a page by itself. What Google does ask for is simpler:

  • Readable words: a URL made of words tells a searcher what the page is about before the click.
  • Hyphens between words: Google recommends hyphens over underscores. WordPress slugs already use hyphens.
  • One consistent case: Google treats URLs as case sensitive, so links should use the lowercase form WordPress generates.

Our suggestion is to choose a structure for readers and for upkeep. A short, descriptive URL is easier to read in a search result, easier to share and less work to keep stable for years.

The Default on a New Install

A new site isn't always on Plain. Since WordPress 4.2, the installer tries to turn on Day and name and tests whether the server can rewrite URLs. It falls back to Plain when that test fails.

Many hosting installers go further and set Post name for you. It is wise to open Settings > Permalinks before you publish the first post and confirm which structure the site is using.

A permalink is the permanent URL of a post, page or archive on your site. It is the address people link to, share and bookmark, and the address Google stores for the page.

The permalink structure is a template for post URLs. Other content types follow their own rules, and that decides what moves when you change the setting:

  • Posts follow the structure exactly.
  • Pages always use their own slug, nested under the parent page, such as example.com/about/team/.
  • Category and tag archives use the bases category and tag, such as example.com/category/news/.
  • Custom post types use the slug they were registered with, such as example.com/recipes/chocolate-cake/.
  • A fixed prefix in a custom structure, such as /blog/%postname%/, is also added to category, tag and author archives.

The slug is the last part of the URL that names one post. WordPress builds it from the title, and you can edit it in the post editor. Our guide on how search engines work explains how a URL gets crawled and stored once it is public.

A custom structure is built from structure tags. Each tag is a placeholder that WordPress fills in for every post. You type them into the Custom Structure field under Settings > Permalinks.

Tag

What WordPress inserts

Example

%year%

Year the post was published, 4 digits

2026

%monthnum%

Month, 2 digits

05

%day%

Day of the month, 2 digits

09

%hour%

Hour, 2 digits

15

%minute%

Minute, 2 digits

43

%second%

Second, 2 digits

33

%post_id%

The post's ID number

423

%postname%

The post slug

sample-post

%category%

The category slug, with parent categories as folders

recipes/desserts

%author%

The author's slug

jane-doe

A few rules apply to every custom structure:

  • A unique tag at the end. The structure should end with %postname% or %post_id%, so WordPress can find one post for every URL.
  • Fixed text. /blog/%postname%/ puts every post under /blog/ and keeps pages at the top level.
  • The trailing slash. A structure that ends in a slash produces URLs that end in one.
  • The /index.php/ fallback. On a server with no rewrite module, a structure that starts with /index.php/ still gives readable URLs.

Changing the structure on a live site takes one click. The work is in making every old URL lead to its new address, because WordPress stops serving the old addresses the moment you save.

A new site with nothing indexed needs none of this. You can change the setting and move on.

What WordPress Redirects by Itself

WordPress has 3 safety nets for old URLs:

  • Plain URLs: it redirects ?p=123 to the current structure.
  • Old slugs: it remembers a post's previous slug and redirects it to the new one.
  • A guess on 404s: when a missing URL ends in a post slug, it looks for a post whose slug starts the same way.

We requested old-style URLs for a published post on this site, which runs Post name on WordPress 7.1, to see which patterns those safety nets cover:

Old URL pattern

What WordPress returned

example.com/?p=123 (Plain)

301 to the current URL

example.com/sample-post (no trailing slash)

301 to the URL with the slash

example.com/blog/sample-post/ (one extra folder in front)

301 to the current URL

example.com/2026/05/sample-post/ (Month and name)

404

example.com/2026/05/09/sample-post/ (Day and name)

404

example.com/archives/123 (Numeric)

404

Dated and numeric URLs are the usual reason for a change, and both returned a 404. A site leaving one of those structures needs its own redirect rule.

We wouldn't rely on the guess even where it works. It matches the start of a slug, so a short old slug can send a visitor to a different post.

The old-slug memory covers posts and custom post types only. A page whose slug changes gets no redirect from WordPress.

Redirect Rules for the Old URLs

One pattern rule can redirect every post, because the post slug stays the same and only the part in front of it changes. On Apache, these rules go in .htaccess above the # BEGIN WordPress line. You need only the rule that matches your old structure:

# Day and name to Post name
RedirectMatch 301 ^/[0-9]{4}/[0-9]{2}/[0-9]{2}/(?!feed/?$)([^/]+)/?$ /$1/

# Month and name to Post name
RedirectMatch 301 ^/[0-9]{4}/[0-9]{2}/(?![0-9]{1,2}/?$)(?!feed/?$)([^/]+)/?$ /$1/

# Numeric to Post name (WordPress finishes the redirect from ?p=)
RedirectMatch 301 ^/archives/([0-9]+)/?$ /?p=$1

On Nginx, the same rules go inside the site's server block. The quotes are required because the patterns contain curly braces:

# Day and name to Post name
rewrite "^/[0-9]{4}/[0-9]{2}/[0-9]{2}/(?!feed/?$)([^/]+)/?$" /$1/ permanent;

# Month and name to Post name
rewrite "^/[0-9]{4}/[0-9]{2}/(?![0-9]{1,2}/?$)(?!feed/?$)([^/]+)/?$" /$1/ permanent;

# Numeric to Post name (WordPress finishes the redirect from ?p=)
rewrite "^/archives/([0-9]+)/?$" /?p=$1 permanent;

Each rule skips date archives and feeds, so example.com/2026/05/ keeps working. The numeric rule sends the visitor to the plain ?p= URL, and WordPress then redirects that to the new address. That is 2 hops, which is fine for a structure this rare.

A server rule answers before WordPress loads, so it is the fastest option. If you can't edit server files, the free Redirection plugin and the Redirections module in Rank Math both accept the same regular expressions.

Our own free toolkit, Functionalities, also has a redirect module. We recommend keeping all redirects in one place, whichever tool you pick.

A move from Post name to a category structure can't use a pattern, because each post has its own category. That change needs a full map of old and new URLs, one row per post. Our comparison of 301 and 302 redirects explains why a permanent move should always use a 301.

The Order We'd Follow

This is the order we'd follow on a site with traffic:

  1. A list of the current URLs. The XML sitemap or a crawl gives you every post URL. This list is what you test against later.
  2. A full backup. It should cover the database and the server config file you are about to edit.
  3. The redirect rule on a staging copy. You request 10 or 20 old URLs there and confirm that each one lands on the right post with a 301.
  4. The structure change. Go to Settings > Permalinks, select Post name and click Save Changes.
  5. Internal links. Links inside your posts still point at the old pattern, and each one now passes through a redirect.
  6. A test of the saved list. Every old URL should answer with one 301 and end on a page that returns 200.
  7. The sitemap in Search Console. You resubmit it, then watch the Pages report for new Not found (404) entries over the next few weeks.

For the internal links, WP-CLI can rewrite dated links in one pass. This example removes a Day and name prefix, and the dry run shows the count before anything changes:

wp search-replace 'https://example\.com/[0-9]{4}/[0-9]{2}/[0-9]{2}/([^/"]+/)' 'https://example.com/\1' \
  --regex --skip-columns=guid --dry-run

Removing --dry-run makes the change. Our WP-CLI search-replace guide covers the flags and the backup step in detail. If this change is part of a host or domain move, our WordPress migration tutorial has the full sequence.

When to Leave the Structure Alone

An established site that ranks well on a dated structure has little to gain from switching. Google says the words in a URL path barely affect rankings, so the upside is small. The risk of a missed redirect across thousands of posts is real.

We'd change a live site in 3 situations:

  • The site is on Plain or Numeric. The URLs tell readers nothing, and the redirect work is light.
  • Dates are hurting evergreen content. Guides you update every year carry an old year in the URL, and readers skip them for that reason.
  • The site is small or young. With a few dozen posts, you can test every redirect by hand in an hour.

Outside those cases, our advice is to keep the structure you have and spend the time on the content.

Rewrite Rules for Apache and Nginx

Every structure except Plain depends on the web server passing requests to WordPress. When that part is missing, the homepage loads and every post returns a 404.

On Apache, WordPress writes this block to .htaccess when you save the Permalinks screen:

# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

If the block is missing, the file is usually not writable. WordPress then shows the rules at the bottom of the Permalinks screen for you to paste in. Apache also needs mod_rewrite enabled and AllowOverride set to allow the file.

Nginx has no .htaccess, so WordPress can't write the rule for you. The site's server block needs this line, which comes from the WordPress Nginx documentation:

location / {
    try_files $uri $uri/ /index.php?$args;
}

After adding it, Nginx needs a reload. On a host that offers neither option, a structure that starts with /index.php/ is the fallback.

WP-CLI changes and repairs permalinks without the dashboard, which helps on staging sites and in deploy scripts. These 4 commands cover most permalink work:

# Show the current structure
wp option get permalink_structure

# Switch to Post name
wp rewrite structure '/%postname%/'

# Rebuild the rewrite rules after adding a post type or taxonomy
wp rewrite flush

# List the rules WordPress is using
wp rewrite list --format=table

On Apache, wp rewrite structure and wp rewrite flush update the database rules only. Adding --hard also rewrites .htaccess, and WP-CLI needs to be told that mod_rewrite is available. That takes 2 lines in wp-cli.yml:

apache_modules:
  - mod_rewrite

The --hard flag works on single-site installs only. On multisite, --url selects the site the command runs against. Our WP-CLI commands cheat sheet lists the other commands worth knowing.

Category, Tag and Custom Post Type URLs

Archives and custom content have their own URL settings. They sit on the same Permalinks screen or in the code that registers the content type.

Category and Tag Bases

Category archives live under /category/ and tag archives under /tag/ by default. The Optional section of the Permalinks screen lets you rename both, for example to /topics/ and /labels/.

WordPress won't remove the base completely by itself. Rank Math and other SEO plugins have a setting that strips the category base. That setting is safe only on a site where no page shares a slug with a category, because the 2 would then compete for the same URL.

Categories in Post URLs

With %category% in the structure, each post URL includes one category. These points decide whether it works for your site:

  • One category is used. When a post has several, WordPress picks the one with the lowest ID. SEO plugins such as Rank Math let you set a primary category that takes its place.
  • Subcategories become folders. A post in Desserts under Recipes gets example.com/recipes/desserts/sample-post/.
  • Recategorizing changes the URL. WordPress redirects a request with the old category to the current URL, so visitors still arrive. Links from other sites will pass through that redirect from then on.

Custom Post Type URLs

A custom post type takes its URL from the rewrite argument used when it is registered. This example puts recipes under /recipes/:

register_post_type( 'recipe', array(
    'public'      => true,
    'label'       => 'Recipes',
    'has_archive' => 'recipes',
    'rewrite'     => array(
        'slug'       => 'recipes',
        'with_front' => false,
    ),
) );

with_front matters when your structure has a fixed prefix. With /blog/%postname%/ and with_front left on, a recipe URL becomes example.com/blog/recipes/chocolate-cake/. Setting it to false keeps recipes at example.com/recipes/chocolate-cake/.

WordPress doesn't know about a new post type's URLs until the rewrite rules are rebuilt. Saving the Permalinks screen once or running wp rewrite flush does that. Our custom post types tutorial covers registration from start to finish.

WooCommerce Product URLs

WooCommerce adds a Product permalinks section to the same screen, with 4 choices:

  • Default: example.com/product/hoodie-with-logo/
  • Shop base: example.com/shop/hoodie-with-logo/
  • Shop base with category: example.com/shop/hoodies/hoodie-with-logo/
  • Custom base: any text you choose in front of the product name

Product categories use /product-category/ and product tags use /product-tag/. WooCommerce requires the product base and these bases to be different, so WordPress can tell a product from a category. Our recommendation is to keep the default /product/ base unless the store has a clear reason to change it.

Multisite

Each site in a network has its own permalink settings. In a subdirectory network, WordPress adds /blog/ in front of post URLs on the main site, so they can't collide with the addresses of the other sites. Our WordPress multisite guide covers the network settings around this.

Trailing Slashes, Case and Slugs

3 small details decide whether one post ends up with one URL or several.

  • Trailing slash: WordPress follows the structure. If it ends in a slash, WordPress redirects example.com/sample-post to example.com/sample-post/. Google treats the 2 forms as separate URLs, so your internal links should use the form the site serves.
  • Case: WordPress slugs are lowercase. On this site, the same post also loaded at an uppercase version of its URL with no redirect. Google treats those as different addresses, so links should always use the lowercase form.
  • Slug length: WordPress builds the slug from the full title. It is wise to shorten it to the few words that name the topic before publishing, because a short slug is easier to read and share.

A canonical tag tells Google which version to keep when duplicates do appear. Our guide to canonical tags explains how that works, and consistent internal linking keeps the duplicates from spreading.

The pattern of the errors usually points to the cause. These are the common cases:

  • The homepage works and every post is a 404. The server isn't passing requests to WordPress. Saving the Permalinks screen again rewrites .htaccess on Apache. On Nginx, the try_files line is missing.
  • New URLs work and old URLs are 404. The redirect rule is missing or doesn't match. Testing one old URL shows which.
  • Only a custom post type is a 404. The rewrite rules were not rebuilt after the post type was registered. wp rewrite flush fixes it.
  • One post is a 404. Its slug may match a real folder on the server, or a category when the category base is stripped.
  • The fix is in place and the 404 remains. A page cache or CDN is still serving the old response, and purging that URL clears it.

Google will also report some 404s after the change. Our guide to fixing 404 errors in Search Console shows which ones need a redirect and which you can ignore.

What is the difference between a permalink and a slug?

A permalink is the full URL of a post or page, such as example.com/blog/sample-post/. The slug is only the last part that names the item, here sample-post. The permalink structure decides what goes around the slug. You edit the slug itself in the post editor.

What is the default permalink structure in a new WordPress install?

Since WordPress 4.2, the installer tries to turn on Day and name and checks that the server can handle it. If the check fails, WordPress falls back to Plain, the ?p=123 format. Many hosting installers set Post name for you. It is worth opening Settings > Permalinks on day 1 to confirm what the site is using.

Do WordPress permalinks affect page speed?

No, not in any current version. Old WordPress releases resolved URLs slowly when a structure started with the post name or the category, and WordPress 3.3 fixed that in 2011. Today the choice between Post name, a dated structure and a category structure makes no practical difference to load time.

Do pages follow the permalink structure?

No. A page always uses its own slug, nested under its parent page, as in example.com/about/team/. Dates, categories and a fixed prefix such as /blog/ in the structure apply to posts only. This is why changing the structure moves every post and leaves pages where they are.

Can I add .html to WordPress post URLs?

Yes. A custom structure such as /%postname%.html works for posts. It is mostly useful when you move an old static site into WordPress and want to keep the addresses it already has. Pages don't take the extension from this setting, so a migrated site may still need redirects for them.

Does changing a single post's slug need a redirect?

For a published post or a custom post type entry, WordPress remembers the old slug and redirects it to the new one. It doesn't do this for pages. A page whose slug changes needs a manual 301, and Rank Math's Auto Post Redirect option can create it for you.

Can 2 posts have the same slug?

No. WordPress keeps slugs unique inside a post type, so a second post with the same title gets -2 at the end of its slug. The better route is to edit the slug before publishing instead of living with the suffix.

How long should redirects stay after a permalink change?

Google's guidance for moved URLs is to keep redirects for as long as possible, and generally for at least 1 year. Other sites and old bookmarks keep sending visitors to the old addresses for much longer than that. A pattern rule costs nothing to keep, so our advice is to leave it in place for good.

Final Remarks

If the site is new, we'd set Post name today and not think about it again. That one choice avoids every redirect problem in this guide.

If the site is live, we'd let the current structure decide. Plain and Numeric are worth changing now. A dated structure on a site that ranks well can stay, and a dated structure on evergreen guides is worth moving with a tested redirect rule.

If you'd rather not run that change on a site that earns money, our website migration service plans the URL map, the redirects and the checks after launch.