Changing post type or taxonomy slugs

Post type renaming

In Custom Post Type UI version 1.1.0, we added the ability for our users to rename post type slugs while preserving the posts created for the post type.

If you are wanting to rename the slug used for a post type, follow these steps.

  1. Click on the “Edit Post Types” tab in the “Add/Edit Post Types” area.
  2. Select the post type you want to rename so the proper post type is chosen for editing.
  3. Enter the new slug you want to use.
  4. Check the available checkbox to migrate the posts in the post type.
  5. Click the “Save Post Type” button.

If everything went well, you should have a newly renamed post type that has all the posts from the previous post type slug. The original post type should also be deleted from the Custom Post Type UI settings.

Taxonomy renaming

In version 1.3.0, we added support for taxonomy renaming with preservation of terms. 

If you are wanting to rename the slug used for a taxonomy, follow these steps.

  1. Click on the “Edit Taxonomies” tab in the “Add/Edit Taxonomies” area.
  2. Select the taxonomy you want to rename so the proper taxonomy is chosen for editing.
  3. Enter the new slug you want to use.
  4. Check the available checkbox to migrate the terms in the taxonomy.
  5. Click the “Save Taxonomy” button.

If everything went well for this, you should have a newly renamed taxonomy that has all the terms from the previous taxonomy. The original taxonomy should also be deleted from the Custom Post Type UI settings.

Caveats of renaming post types or taxonomies

One thing you will need to keep in mind with renaming your post types or taxonomies is that if you’re referencing the slugs anywhere in template files, plugin files, or settings in the WordPress admin, you will need to make sure those are updated to the new slugs. Without taking these steps, those locations will no longer accurately work or query the proper data.

Updated Dec 12, 2022 9:08 PM