Title: Changing Custom Post Type&#8217;s name
Last modified: January 18, 2021

---

# Changing Custom Post Type’s name

 *  Resolved [Obje](https://wordpress.org/support/users/harrow/)
 * (@harrow)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/changing-custom-post-types-name/)
 * Hi,
 * I have difficulties to rewrite the slug of a custom post type… Previously the
   CPT was named ‘conversations’ but I have to change it for ‘instruments’. I’ve
   made all the labelling changes but I can’t make the slug rewriting working properly.
   The url of the posts keep being [https://www.xxxx.com/conversations/name-of-the-post](https://www.xxxx.com/conversations/name-of-the-post)(
   permalinks refreshed).
 * Please find my code below :
 *     ```
       <?php
       function elro_cpt_instruments() {
           $labels = array(
               'name' => 'Instruments',
               'all_items' => 'Tous les Instruments',
               'singular_name' => 'Instrument',
               'add_new_item' => 'Ajouter un instrument',
               'edit_item' => 'Modifier cet instrument',
               'menu_name' => 'Instruments',
               'rewrite' => array('slug' => 'instruments'),
           ); 
           $args = array(
               'labels' => $labels,
               'public' => true,
               'show_in_rest' => true,
               'has_archive' => false,
               'supports' => array( 'title', 'editor','thumbnail' ),
               'menu_position' => 5, 
               'menu_icon' => 'dashicons-book-alt',
           );
           register_post_type( 'conversations', $args );
       }
   
       add_action( 'init', 'elro_cpt_instruments', 0 );
       ```
   
 * I could write a filter to do that but I’d prefer my slug rewriting to work into
   my CPT declaration.
 * What am I doing wrong?
    Thanks by advance for your help!

Viewing 1 replies (of 1 total)

 *  Thread Starter [Obje](https://wordpress.org/support/users/harrow/)
 * (@harrow)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/changing-custom-post-types-name/#post-13921454)
 * My bad, the rewrite paramter goes into the $arg array.

Viewing 1 replies (of 1 total)

The topic ‘Changing Custom Post Type’s name’ is closed to new replies.

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 1 participant
 * Last reply from: [Obje](https://wordpress.org/support/users/harrow/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/changing-custom-post-types-name/#post-13921454)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
