In this tutorial, you will learn how to change a custom taxonomy slug in WordPress easily and quickly without using plugins. Of course, you can make changes to the code of the registration custom taxonomy, but it is not always easy and expedient to do it. Consider an example of how to do this by adding several lines of code to the functions.php file in your WordPress theme.
Before making any changes, be sure to backup your website (database and files).
How to change a custom taxonomy slug without a plugin
All the necessary actions do on the example of our Mercury theme. It has a custom post type “Games” that contain a custom taxonomy “Categories” with the “game-category” slug.
1) Go to “Appearance” – “Theme Editor“. Select functions.php theme file. Paste this code at the end of the file.
Instead of the “old-slug“, add a current slug of the custom taxonomy, which you want to change. And instead of the “new-slug“, add a new slug name.
2) Go to “Settings” – “Permalinks“. Click the “Save Changes” button. This must be done for the new slug to start working.