How to Remove Parent Slugs From WordPress URLs

In WordPress, you may register both hierarchical and non-hierarchical post types and taxonomies. Both are useful when creating websites with either a tree hierarchy or a flat structure. Understanding the structure and hierarchy of permalinks is crucial for organizing your content.

By default, hierarchical content types use permalinks that include the slugs of both parent and child pages/terms. Non‑hierarchical content types use a simpler permalink structure without parent slugs.

“Flattening” URLs can improve readability, which may help user experience and SEO. The tricky part is that changing the URL structures usually means writing custom code to override how WordPress builds permalinks.

If you want a simpler solution and prefer not to touch code, you can use Permalink Manager to safely remove parent slugs from hierarchical URLs. The plugin safely updates permalinks and automatically redirects old URLs for existing content.

Flatten URLs and keep one slug only

Hierarchical Post Types and Taxonomies in WordPress

Hierarchical Content Types

A hierarchical post type is one in which each of its single items can have a parent and one or more children. It is very much like how WordPress's pages work.

Here is a simple example of how you might organize a website with this type of content. Imagine you need to list all your company locations on the website:

  1. Start with a top-level item such as "Americas".
  2. Add a parent page named "North America".
  3. Then, you place a child page named "Canada" right under it.

"Page" is a inbuilt hierarchical post type

Their permalinks will reflect this hierarchy and include both the parent and the child slugs. The more parents a post or term has, the more parts its permalink will have.

This often helps SEO, since the URL clearly shows the content structure for search engines and for visitors:

Hierarchical post type (location):
http://example.com/americas/
http://example.com/americas/north-america/
http://example.com/americas/north-america/canada/

Non-Hierarchical Content Types

Non‑hierarchical post types and taxonomies have a flat structure. Besides standard posts, WooCommerce products are another excellent example of non-hierarchical content types.

None of these have parents or children. Each one exists on a single, flat level.

"Post" is a non-hierarchical post type

This simple structure works well when you do not need a hierarchy. For example, in a blog with tutorial articles, each post is separate, with no nested posts or subpages:

Non-hierarchical post type (article):
http://example.com/how-to-add-php-snippet-to-wordpress/
http://example.com/change-author-pagination-base-in-wordpress/
http://example.com/6-seo-tips-for-better-wordpress-permalinks/

Step-by-Step Instructions

In the next section, you will find steps that show how to remove parent slugs from hierarchical content types. If you want to do the opposite and add taxonomies to custom post types' permalinks, please check out the separate article that explains this in detail.

With Permalink Manager, you can adjust URL structure and "flatten" the permalinks in different ways.

  1. You can also remove all parent slugs from hierarchical taxonomies and post types, like in the second example ( car-brand/asia/korea/hyundai ).
  2. You may keep just the top level parent slug for a taxonomy term inside a custom post type item, as shown in the first example ( car/ford/hatchback/fiesta ).
Remove Custom Post Type/Taxonomy Slug
If needed, you may also remove the rewrite slug (e.g. "car" or "car-brand"), to make URLs even shorter.

Step 1: Open the Permastructure Editor

To delete parent slugs and flatten your URLs, you have to use the "Permastructure" editor. You can find it under "Tools -> Permalink Manager -> Permastructures".

To edit WordPress permalink structure go to "Permastructures" admin section

Scroll to the post type or taxonomy you want to edit and change the permalink structure if needed.

  • If you want to flatten hierarchical custom post types or taxonomies, follow step 2A.
  • If you want to remove custom taxonomy slugs from single URLs of custom post types, follow step 2B.

Step 2A: Remove Parent Slugs From Custom Post Types/Taxonomies

When you open the Permastructures editor, each content type should have its own permastructure tag. This tag is replaced by the actual slug of content item. If the item has parents, their slugs are included too.

Pages use %pagename% . Custom post types use %{custom-post-type-name}% , for example %car% . Categories and custom taxonomies follow the same rules.

If you want the permalink to flatten the permalink and skip parent slugs, simply add "_flat" to the permastructure tag. Use these formats:

Pages & Custom Post Types

  • %page_flat% for pages
  • %{custom-post-type-name}_flat% (e.g. %car_flat% ) for custom post types

Alternatively, you can also use %postname_flat% for custom post types.

Categories & Custom Taxonomies

  • %category_flat% for categories
  • %{custom_taxonomy_name}_flat% for custom taxonomies

Alternatively, you can also use %term_flat% for custom taxonomies.

Remove parent slugs from "Cars" permalinks
The %postname_flat% permastructure tag is universal and can be used for all post types.
Remove parent slug from taxonomy permalinks
Similarly to the %postname_flat% tag for post type permastructures, the %term_flat% tag may be used for any taxonomies.

Step 2B: Remove Parent Taxonomy Slugs From Custom Post Type Items' URLs

If you use Permalink Manager to add taxonomy slug to custom post type URLs, the plugin respects hierarchical taxonomies, so if the selected term has a parent, the post's permalink includes the child slug and all parent slugs.

If needed, you can choose either the top-level term's slug or the bottom-level term's slug for that post's permalink.

Use Top-Parent Term

The first method for removing the hierarchy of the related taxonomy term is to use just the slug of the top-parent term by appending "_top" to the end of the taxonomy tag (e.g. %location_top% instead of standard %location% tag).

Append "_top" to the end of Permastructure tag.Top slug only

Use Lowest-Level Term

Alternatively, you may flatten the taxonomy tag hierarchy using only the slug of the lowest-level term by appending "_flat" to the end of the tag (e.g. %location_flat% instead of standard %location% tag).

Append "_flat" to the end of Permastructure tag.

Lowest level slug only

After editing the Permastructures, scroll to the bottom of the page. Click the "Save permastructures" button to save your new settings.

"Save permastructures" button

Important
The changes only apply to new content. Existing posts and pages keep their old URLs. You must regenerate permalinks to update existing content.

To apply the modifications to existing URLs, you must "regenerate" them.

FAQ

What Happens to My Old URLs After I Remove the Parent Slugs?

If you do not regenerate permalinks, your old URLs remain exactly as they were with parent slugs included. By default, Permalink Manager only applies new permalink rules to content you create from now on.

Once you do regenerate, the plugin keeps the previous URLs working by setting up automatic redirects, so visitors and search engines are sent to the new location without hitting a dead end.

Does This Work With Woocommerce and Custom Post Types or Taxonomies?

Yes. The plugin supports any custom post type or taxonomy that is properly registered in WordPress. This includes WooCommerce permalinks, as well as post types added by real estate plugins, job boards, or portfolio tools.

If the content type appears in your WordPress dashboard, it will appear in the Permastructures editor. You can apply the same flat tags like %product_cat_flat% or %job_listing_flat% to them the same way you would for native WordPress pages or categories.

Can I Remove Parent Slugs With Native WordPress Settings?

No. WordPress built‑in permalink settings cover only standard content types like posts and categories. They do not allow you to remove parent slugs or create fully custom structures for custom post types and taxonomies.

You cannot flatten hierarchical URLs or combine taxonomies with post permalinks using native options. To do this, you need a permalink plugin or a code snippet that changes the default permalink behavior.

Permalink Manager includes a visual “Permastructures” editor. It allows you to control the URL format for every content type. This makes it possible to remove parent slugs and add taxonomy terms.

Last updated by Maciej Bis on: April 8, 2026.


Maciej BisFounder of Permalink Manager & WordPress Developer

The developer behind Permalink Manager, a plugin for managing permalinks, has been working with WordPress, creating custom plugins and themes, for more than a decade.

Go up