Changing Custom Post Type Slug
Sometimes you don’t want to use the default slugs for the posts, and that’s why you might need to change the slugs to your custom ones.
From this tutorial you’ll learn how to change custom post type slug. Pay attention, that the method described below works for the first themes under GPL license. There is another link format for other themes.
Steps to Change Custom Post Slug
- First, log in to WordPress Dashboard. Navigate to Appearance tab in the left column. Click on Editor submenu.
- Find Theme Functions link in the column on the right side of the Editor page. Open it.
- Scroll down the code to its very end and add the following lines of code:
- In our example we add ‘our-services’ slug. But you can change ‘our-services’ to any other name you want to use as a slug on your website. Feel free to use this method to change slugs for Cherry Services, Cherry Projects, Cherry Team Members, etc. Though, you’ll need to paste the corresponding post types and slugs in the code to make it work. You can view the examples of code to change slugs for Cherry Projects, Cherry Team Members and Cherry Testimonials below.
- Save the changes. To do it click on Update File.
- Now you need to refresh all the permalinks for your changes to take place. Proceed to Settings tab in the left column of the Dashboard.
- Click on Permalinks sub menu.
- Click on Save Changes button.
- Now you can navigate to your website and open a single post page to view the new slug.