October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

How to Include Categories and Subcategories in WordPress URLs

Use WordPress’s custom permalink structure to include category and subcategory slugs in post URLs, and understand how this differs from category archive paths.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To include a post’s category path in its WordPress URL, go to Settings → Permalinks, choose Custom Structure, and enter /%category%/%postname%/. WordPress uses the category slug in the post permalink; for a post in a child category, the URL can show the parent and child as nested directories.

Set up the category hierarchy

  1. In the dashboard, go to Posts → Categories.
  2. Create or edit a category, give it a clear slug, and select its parent in the Parent field if it is a subcategory. WordPress uses category slugs in URLs. See the Posts Categories screen documentation.

A child category can be assigned to a post whether or not you also explicitly assign the post to its parent.

As an Amazon Associate I earn from qualifying purchases.

Add the category path to post URLs

  1. Go to Settings → Permalinks.
  2. Select Custom Structure and enter /%category%/%postname%/. The structure must identify an individual post; WordPress advises ending it with %postname% or %post_id%.
  3. Click Save Changes.
  4. Open a post assigned to a child category and check its URL. The %category% tag inserts the category path. WordPress.org’s Customize permalinks documentation explains that nested subcategories appear as nested directories in the URI.

For example, a post with the slug red-fox in the mammals subcategory under animals can have a path like /animals/mammals/red-fox/. This illustrates the structure; the final URL depends on the site’s actual category and post slugs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose between category-based and shorter post URLs

Permalink choice What it changes Considerations
/%category%/%postname%/ Includes the selected category path and post slug in individual post URLs. Makes hierarchy visible, but can make URLs longer and ties them to category assignments.
/%postname%/ Uses the post slug without a category path. Keeps individual post URLs shorter; WordPress lists “Post name” as a built-in permalink option.
Custom category base Changes the prefix on category archive URLs, such as /topics/animals/. It does not add category paths to individual post URLs.

WordPress’s Settings Permalinks screen guide covers the built-in options and category base. The standard setting lets you change that base from the default category, but does not remove the base altogether.

Know what happens with multiple categories

If a post has more than one category, WordPress includes only one in the permalink, not every assigned category. The current WordPress guide says it selects the displayed category alphabetically; it notes that plugins can let you choose which category appears. Consider this when deciding whether your post URLs should depend on category assignment.

Protect existing links when changing permalinks

WordPress describes permalinks as permanent and advises against changing them. On an established site, changing the structure can change post URLs, so plan how readers and other sites will reach existing links and check important old URLs after the change. The cited WordPress documentation does not say that this setting automatically creates redirects.

If the new URLs do not work

Pretty permalinks may require server configuration. WordPress notes that the setup depends on the hosting environment; if the URLs fail after saving, contact your hosting provider and ask whether the server supports the selected permalink structure. See the permalink guidance and Permalinks screen documentation.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What this means for SEO

WordPress describes readable URLs as useful to people and search engines, but the documentation cited here does not establish that adding category levels produces a ranking benefit. Choose a structure for clarity and stability rather than assuming a deeper category path will improve rankings.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.