SEO

WordPress Permalinks and URL Structure: Getting It Right the First Time

WordPress Permalinks and URL Structure: Getting It Right the First Time

Most site owners set their permalink structure once, during setup, and never think about it again. That’s fine when the choice was a good one. But I regularly work with sites where an early decision, such as including dates in blog URLs, using long auto-generated slugs or building deep category paths, has become a problem years later. Changing URLs on an established site is possible, but it means redirects, temporary ranking fluctuations and a lot of careful checking. WordPress permalinks deserve more thought than they usually get.

This article covers how WordPress permalinks work, which structures suit which sites, how to write good slugs, how to plan URLs for custom post types and how to change things safely if you need to.

What permalinks are

A permalink is the permanent URL for a post, page or archive. WordPress generates permalinks from a structure you set under Settings, Permalinks, using tags such as %postname%, %category%, %year% and %post_id%.

The default for new installations is now the post name structure, giving URLs like:

Older installations sometimes still use “plain” permalinks like ?p=123, which are hard to read and share. If your site still uses plain permalinks, changing to a readable structure is worth doing, with redirects.

Choosing a structure for posts

Post name only

Short, readable and timeless. It doesn’t reveal when a post was written, so evergreen articles don’t look dated. It’s the right choice for most business sites and blogs.

Category and post name

This includes the category in the URL, like /wordpress-security/hardening-guide/. It shows the topic and creates a sense of hierarchy. The downside is that changing a post’s category changes its URL, and posts in multiple categories use only the primary or first one. WordPress handles redirects from old URLs in some cases, but not reliably in every situation. Use this structure only if your categories are stable and each post has one clear category.

Dates in the URL

Dates suit news sites, where the date is meaningful and articles are rarely updated. For most other sites, dates make evergreen content look old, make URLs longer and complicate updating posts. If you refresh a 2019 article in 2026, its URL still says 2019.

Post ID

Including the ID guarantees unique URLs and can help very large news sites, but it adds noise. Most sites don’t need it.

Pages and hierarchy

Pages don’t use the post permalink structure. They use their slug and their parent pages:

This hierarchy is useful for organising service and information pages. Keep it shallow, ideally no more than two or three levels deep. Deep nesting creates long URLs and makes reorganising harder, because moving a parent page changes the URLs of all its children.

Writing good slugs

The slug is the part of the URL that identifies the specific post or page. WordPress generates it from the title, but auto-generated slugs are often too long:

A better slug is short, descriptive and timeless:

Guidelines:

  • Use a few meaningful words, usually including the main topic or keyword
  • Remove stop words like “a”, “the”, “and”, “you”, “can” where they don’t add meaning
  • Avoid dates and numbers that may change, like years or “10 ways”
  • Use hyphens between words, which WordPress does automatically
  • Use lowercase
  • Avoid special characters

Set the slug before publishing. Changing it after the page is indexed and linked requires a redirect.

Category and tag bases

By default, category archives use /category/ and tag archives use /tag/ in their URLs:

You can change these bases under Settings, Permalinks, for example to /topics/. Some SEO plugins also offer to remove the category base entirely, giving /wordpress-security/.

Removing the base gives shorter URLs but can create conflicts with page slugs, because WordPress has to work out whether /wordpress-security/ is a page or a category. On established sites, the benefit is small and the change requires redirects. On new sites, it’s a matter of preference.

Custom post type URLs

Custom post types get their own URL structure, set when registering them through the rewrite argument:

That gives individual items at /case-studies/clinic-redesign/ and an archive at /case-studies/.

Things to plan:

  • The slug: plural and readable, matching how people would describe the section
  • with_front set to false: otherwise, if your post structure has a prefix like /blog/, custom post types inherit it
  • Archive URL: matching the slug, so the section has a natural landing page
  • Conflicts: make sure no page has the same slug as the post type archive

After registering or changing rewrite settings, visit Settings, Permalinks to flush rewrite rules.

WooCommerce URLs

WooCommerce products default to /product/product-name/ and categories to /product-category/category-name/. You can change these bases under Settings, Permalinks in the product permalinks section, for example to /shop/ for products. Options that include the category in product URLs create longer URLs and can produce duplicates for products in several categories, so most stores are better off with a simple base.

Trailing slashes and consistency

WordPress adds a trailing slash to URLs when the permalink structure ends with one, which it usually does. Whatever you choose, be consistent. WordPress redirects the non-preferred version automatically, but internal links should always use the canonical form to avoid unnecessary redirects.

The same applies to www versus non-www and HTTP versus HTTPS. Choose one canonical version, set it in Settings, General, and make sure the server redirects everything else to it.

Changing permalink structure on an existing site

Sometimes a change is worth making, such as removing dates from blog URLs. Do it carefully:

  1. Back up the site.
  2. Crawl the current site and save the list of URLs.
  3. Change the structure on staging first and crawl again to compare.
  4. Plan redirects from old URLs to new ones. WordPress redirects some changes automatically, but for structural changes, add explicit rules, often a single regular expression rule at the server or in a redirect plugin.

For example, removing dates:

  1. Apply the change in production, test the redirects and update internal links in content to point directly to new URLs.
  2. Submit the updated sitemap in Search Console and monitor crawl errors.

Expect some fluctuation for a few weeks while search engines process the redirects.

Planning URLs for a new site

When starting a new WordPress site, sketch the URL structure before building anything. List the main sections, such as services, case studies, blog, resources and shop, and decide the URL pattern for each. Write down the permalink structure for posts, the bases for categories and products, and the slug for each custom post type.

A simple plan might look like this: posts at /%postname%/, services as pages under /services/, case studies as a custom post type at /case-studies/, and products under /shop/. Ten minutes of planning like this avoids conflicts, such as a page and a post type archive fighting over the same slug, and spares you a migration later.

International and multilingual URLs

Sites in several languages need a URL strategy for each language, typically subdirectories like /en/ and /hi/, subdomains or separate domains. Multilingual plugins handle this, but the choice should be made early, because it affects every URL on the site. Subdirectories are usually the simplest to manage on WordPress and keep all content under one domain.

Keep a record of URL changes

Whenever URLs change, whether through restructuring, renamed slugs or removed content, record the old and new URLs and the redirect in place. Redirect plugins and server configurations do the work, but a simple log of what changed and why becomes invaluable when investigating traffic changes or broken links months later.

Short URLs are easier to share

Short, clean URLs are easier to read aloud, print on brochures, type from memory and paste into messages. When someone shares your page on WhatsApp or in an email, a readable URL tells the recipient what to expect before they click. That small trust signal is one more reason to keep slugs concise and meaningful from the start.

Check your settings today

If you haven’t looked at Settings, Permalinks since your site was set up, take a minute now. Confirm the structure suits your content, check your category and product bases and make a note of anything you’d change on a future rebuild.

Frequently asked questions

Does keyword in the URL help rankings?

A little, mainly because it helps users understand what a page is about before clicking. Clarity matters more than stuffing keywords.

Should I change old long slugs?

Only if there’s a clear benefit. Changing slugs of well-ranking pages adds risk for minimal gain. Focus on getting new slugs right.

What happens if two posts have the same slug?

WordPress adds a number, like -2, to make the second unique. Check for these, because they often indicate duplicate content.

Do I need to flush permalinks?

After changing permalink settings or registering new post types and taxonomies, yes. Visiting Settings, Permalinks and saving does it.