Title: Changing Post-type URL
Last modified: July 8, 2023

---

# Changing Post-type URL

 *  Resolved [skillbeatsall](https://wordpress.org/support/users/skillbeatsall/)
 * (@skillbeatsall)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/changing-post-type-url/)
 * Hi!
   I have a custom post-type on my website that comes from a theme. The post
   type is named ‘gva_team’. In the URL, it looks like the following:
 * [website]/**teachers**/firstname-lastname
   I want to replace **teachers** with“
   staff”. How would I go about doing this?
 * Thanks 🙂
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fchanging-post-type-url%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Albert Bretado](https://wordpress.org/support/users/abretado1985/)
 * (@abretado1985)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/changing-post-type-url/#post-16880640)
 * See if this works for you,
    1. Open your theme’s `functions.php` file or create a custom plugin file for this
       purpose.
    2. Add the following code to modify the rewrite rules for your custom post type:
 *     ```wp-block-code
       function modify_gva_team_rewrite_rules($args, $post_type)
       {
           if ($post_type === 'gva_team') {
               $args['rewrite']['slug'] = 'staff';
           }
           return $args;
       }
       add_filter('register_post_type_args', 'modify_gva_team_rewrite_rules', 10, 2);
       ```
   
    3. Save the changes to the `functions.php` file or your custom plugin file.
    4. After saving the changes, visit the WordPress admin area and navigate to “Settings”
       > “Permalinks.” Simply clicking the “Save Changes” button will flush the rewrite
       rules.
 * This code uses the `register_post_type_args` filter to modify the `rewrite` parameter
   of the “gva_team” post type registration. It checks if the current post type 
   is “gva_team” and updates the `slug` value to “staff”. This way, the base URL
   will be changed from `/teachers/` to `/staff/`.
 *  Thread Starter [skillbeatsall](https://wordpress.org/support/users/skillbeatsall/)
 * (@skillbeatsall)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/changing-post-type-url/#post-16880878)
 * Perfect solution! Thanks, [@abretado1985](https://wordpress.org/support/users/abretado1985/)!
   ❤️
 *  [Albert Bretado](https://wordpress.org/support/users/abretado1985/)
 * (@abretado1985)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/changing-post-type-url/#post-16881555)
 * Glad it worked!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Changing Post-type URL’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Albert Bretado](https://wordpress.org/support/users/abretado1985/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/changing-post-type-url/#post-16881555)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
