How To Edit Custom Permalinks In Bulk?

One of the primary functions of Permalink Manager is to help you to bulk edit custom permalinks and improve your website’s SEO score.

In a nutshell, rewrite rules allow WordPress determine the content type and slug from the requested URL. Because of the rewrite rules limitations, WordPress itself does not allow for complete permalink customization.

Permalink Manager addresses this and many other permalink issues. The plugin can update the permalinks of all public post types, including posts, pages, and products, to achieve this goal. The premium version of the plugin may also be used to modify the permalinks of taxonomy terms such as categories, tags, and product categories.

Why is Permalink Manager better than the built-in WordPress permalink system? The plugin works around the shortcomings of the built-in permalink system by using a sophisticated algorithm to identify the requested URLs. To boost the algorithm’s performance, all custom permalinks are saved statically in the database and used afterwards to determine which page should be loaded.

Need to edit single permalink?
This article explains how to update multiple permalinks at the same time. If you are interested in more customization, the plugin lets you do so for every one of your URL addresses. More information on how to update the individual custom permalinks may be found here.

Until you manually edit it using the “URI Editor” the initial URL will be based on the permalink format (specified in the “Permastructure” settings section). In other words, Permalink Manager will apply your permastructure settings to generate the new custom permalink whenever a new post or term is published.

How to edit permastructures?

To modify permalinks in mass, you will need to use the “permastructures” editor. To open it, go to “Permastructures” section through the link in the admin sidebar (“Tools -> Permalink Manager“).

Bulk edit permalinks for WordPress post types and taxonomies
As a starting point, permalink input fields will use the native/original formats.

As seen above, you may edit the permastructures for each post type and category independently.
You have total control over how they are adjusted.

Versatility of Permalink Manager
There are a variety of ways to apply them to make your WordPress permalinks more attractive. You can, for example, delete or alter the permalink’s original base. It is also possible to use the same permalink base for different content types or add custom taxonomy terms to permalinks for custom post type items.
Customized permalink format (permastructure) set for sample post type.
Customized permalink format (permastructure) set for sample post type.

If you are unsure if the new “permastructures” settings are correct, you may examine the sample URL address within the “URI Editor“. The new URL based on your updated permalink format (given in the “Permastructure” settings section) will be shown in the “Default URI” row.

How Permastructures affect single permalinks
Current URI” field shows the current canonical permalink.
The “Default URI” field indicates the default format of the custom permalink based on “Permastructure” settings.

You should be aware that when you alter the permastructures, the existing custom permalinks will not be automatically updated. For existing permalinks, you will need to use the “Regenerate/reset” tool to apply the new URL format to the old permalinks.

Regnerate/reset tool
Complete instructions for resetting the custom permalinks may be found here.

Why is the slug automatically appended?

By default, Permalink Manager automatically appends the slugs to the end of custom permalinks. If you would like to disable this, please go the Permastructure section where you have already configured custom permalink formats. Then, below the input boxes, click on the “Show additional settings” button. Now, when the additional container appears, select “Do not automatically append the slug” and save the changes.

Do not automatically append the slug settings

If you would like to manually tweak the custom permalinks, you can use the Bulk URI Editor. The items are grouped by post type and taxonomy for your convenience.

Bulk edit permalinks using URI Editor

Hierarchical permalinks and slugs (How to change them?)

WordPress allows you to register either hierarchical or non-hierarchical content types. If none of these names seems familiar, have a look at the built-in content types.

Pages and categories are both hierarchical in the sense that they may have either a parent or a child. If you look at the example below, the content hierarchy should be obvious.

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

"Page" is a inbuilt hierarchical post type

At the same time, non-hierarchical posts and post tags are impossible to arrange in a “hierarchy tree”. As you can see, their URLs are “flat” and do not include any parent slugs.

Non-hierarchical post type (posts):
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/

"Post" is a non-hierarchical post type

It is sometimes advantageous to have shorter URLs for better SEO performance. Removing the parents’ slugs from children permalinks may be an effective way to do this. However, if you are not acquainted with the WordPress codebase, this might be a complicated process. This is where Permalink Manager comes in handy, allowing you to easily shorten WordPress permalinks.

New permalink formats and existing permalinks
The parent slugs will be automatically removed from all new post URLs. Existing URLs will need to be regenerated if you want to use the new formats on them too. You will find step-by-by-step instructions on how to do this in this post.

Pages and hierarchical custom post types

To help you understand these instructions, we will explain them using a simple example. As you can see below, the custom post type permalinks (“car”) are hierarchical.

Original permalink format
http://example.com/%car%/

http://example.com/car/ford/ford-fiesta/
http://example.com/car/jeep/jeep-wrangler/

Our goal is to get rid of the parent slugs that are attached to them.

New permalink format
http://example.com/%car_flat%/

http://example.com/ford-fiesta/
http://example.com/jeep-wrangler/

The steps are straightforward. If you want to remove the parent slugs and make the hierarchical post types “flat” go to the “Tools -> Permalink Manager -> Permastructures” section. Now, scroll down to the post type you wish to update and change its permastructure settings.

By default, the permastructure tag for posts, pages, or custom post types slugs will be %postname% (for posts), %pagename% (for pages), or the name of the custom taxonomy, e.g. %car%.

You will need to add the “_flat” suffix to the permastructure tags if you only want to include the actual post slug in the permalink and not the parent slugs. Thus, the tags should look like this: %postname_flat%, %page_flat%, or %car_flat%.

Remove parent slugs from "Cars" permalinks
The %postname_flat% permastructure tag is universal and can be used for all post types.

Categories and hierarchical custom taxonomies

As a general rule, if you use Permalink Manager to add a slug of hierarchical taxonomy terms to custom post type permalinks, the plugin will respect the hierarchy tree. In other words, if a term assigned to a certain post contains a parent term, Permalink Manager will include not only the given term’s slug but also its parents.

You may remove parent slugs from taxonomy permalinks in the same way that you removed them from post permalinks. Simply replace default tags: %term% or %custom_taxonomy_name% with %term_flat% or %custom_taxonomy_name_flat% in the permastructure settings.

Original permalink format
http://example.com/%car-brand%/

http://example.com/car-brand/korean/hyundai/
http://example.com/car-brand/european/volvo/

New permalink format
http://example.com/%car-brand_flat%/

http://example.com/hyundai/
http://example.com/volvo/

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.

Post, custom post types with hierarchical taxonomies slugs

If you want to use this plugin to add custom taxonomy slugs to custom post items, the instructions below may be very helpful. This functionality is detailed in greater depth in a separate article, and the information below only pertains to shortening the hierarchical slug added to single post permalinks.

How to add taxonomy slugs to post permalinks?
In this article, you can find detailed instructions on how to add the taxonomy slugs to post permalinks.

Similar to the two sections above, you can also edit the category slug hierarchy tree that is used in post permalink formats as well.

Initial permalink format
http://example.com/%car-brand%/%car%

http://example.com/europe/northern-europe/volvo/s80-2022
http://example.com/asia/pacific/south-korea/i20-2019

New permalink format with top-parent term slug only
http://example.com/%car-brand_top%/%car%

http://example.com/europe/s80-2022
http://example.com/asia/i20-2019

New permalink format with lowest-child term slug only
http://example.com/%car-brand_flat%/%car%

http://example.com/volvo/s80-2022
http://example.com/leather/i20-2019

Frequently asked questions

The native slugs are used by WordPress in posts’ and terms’ original permalinks. They are produced after the article or term is published and hence they remain unchanged even if you update the post/term title later. In certain cases, it may be preferable to dynamically use the title rather than the “static” slug. Please see the following notes for further information how to make Permalink Manager use the titles in the custom permalinks.

Slugs mode
Permalink Manager, like WordPress, will use native slugs by default. In the plugin setting (“Slugs mode” field) you may decide whether either native slugs or actual post titles should be included when new permalinks are generated.

"Slugs mode"

Auto-update permalinks
It is important to remember that Permalink Manager will not update your custom permalinks automatically. If you want it to update automatically, for example, when the post/term title changes, turn on “Auto-update permalinks” mode.

Automatically update permalinks

How to replace the slugs with post/term IDs?

You can use Permalink Manager to add element IDs to custom permalinks by using dedicated tag: %post_id% for posts and %term_id% for terms. However, if you want to use it to totally replace the slug, you will need to do a few further steps.

To begin, you must activate the “Do not automatically attach the slug” option attached to permastructure settings in order to use post/term IDs instead of slugs. Furthermore, you will need to use extra code snippet to help Permalink Manager recognize URLs with numeric endings and separate them from lookalike pagination endpoints.

add_filter('permalink_manager_deep_uri_detect', '__return_true');

Once it is done, you should adjust the permastructures settings and use %post_id% tag

How to add post ids to custom permalinks?

Go up