Title: Post Type name changeable?
Last modified: August 31, 2016

---

# Post Type name changeable?

 *  Resolved [redstormj](https://wordpress.org/support/users/redstormj/)
 * (@redstormj)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/post-type-name-changeable/)
 * I’m nearly done with my website and I am fine tunning some things. I could almost
   swear that at some point I saw an option to change the default post type from“
   listings” to something else, but for the love of God I can’t seem to find that
   anywhere now so I don’t know if I was just dreaming when I saw that.
 * Could you confirm or clarify if it is possible to change the post type name to
   something other than “listings”? In my case I need this because my website is
   in a different language.
 * Thanks!
 * [https://wordpress.org/plugins/wpcasa/](https://wordpress.org/plugins/wpcasa/)

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

 *  Plugin Author [WPSight](https://wordpress.org/support/users/wpsight/)
 * (@wpsight)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/post-type-name-changeable/#post-7251929)
 * Hi redstormj,
 * You can find the corresponding code here: [https://github.com/wpsight/wpcasa/blob/master/wpcasa/includes/class-wpsight-post-types.php#L266](https://github.com/wpsight/wpcasa/blob/master/wpcasa/includes/class-wpsight-post-types.php#L266)
 * With the following code you could change the labels to your needs:
 *     ```
       /**
        * Change listing post type labels
        */
       add_filter( 'wpsight_post_type_labels_listing', 'my_post_type_labels_listing' );
   
       function my_post_type_labels_listing( $labels ) {
   
       	// Set post type labels
   
       	$labels = array(
       	    'name' 			 => _x( 'Listings', 'listing', 'wpcasa' ),
       	    'singular_name' 	 => _x( 'Listing', 'listing', 'wpcasa' ),
       	    'add_new' 		 => _x( 'Add New', 'listing', 'wpcasa' ),
       	    'add_new_item' 	 => _x( 'Add New Listing', 'listing', 'wpcasa' ),
       	    'edit_item' 		 => _x( 'Edit Listing', 'listing', 'wpcasa' ),
       	    'new_item' 		 => _x( 'New Listing', 'listing', 'wpcasa' ),
       	    'view_item' 		 => _x( 'View Listing', 'listing', 'wpcasa' ),
       	    'search_items' 	 => _x( 'Search Listings', 'listing', 'wpcasa' ),
       	    'not_found' 		 => _x( 'No listings found', 'listing', 'wpcasa' ),
       	    'not_found_in_trash' => _x( 'No listings found in Trash', 'listing', 'wpcasa' ),
       	    'menu_name' 	 => _x( 'Listings', 'listing', 'wpcasa' ),
       	);
   
       	return $labels;
   
       }
       ```
   
 * Best regards,
    Simon [WPCasa]
 *  Thread Starter [redstormj](https://wordpress.org/support/users/redstormj/)
 * (@redstormj)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/post-type-name-changeable/#post-7251941)
 * Ha! I knew I had seen that somewhere!
 * Thanks buddy.
 *  Thread Starter [redstormj](https://wordpress.org/support/users/redstormj/)
 * (@redstormj)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/post-type-name-changeable/#post-7251945)
 * Actually, this isn’t working. I must be missing something simple somewhere.
 * I am using:
 *     ```
       /**
        * Change listing post type labels
        */
       add_filter( 'wpsight_post_type_labels_listing', 'my_post_type_labels_listing' );
   
       function my_post_type_labels_listing( $labels ) {
   
       	// Set post type labels
   
       	$labels = array(
       	    'name' 			 => _x( 'Propiedades', 'propiedades', 'wpcasa' ),
       	    'singular_name' 	 => _x( 'Propiedad', 'propiedad', 'wpcasa' ),
       	    'add_new' 		 => _x( 'Agregar Nueva', 'propiedad', 'wpcasa' ),
       	    'add_new_item' 	 => _x( 'Agregar Nueva Propiedad', 'propiedad', 'wpcasa' ),
       	    'edit_item' 		 => _x( 'Editar Propiedad', 'propiedad', 'wpcasa' ),
       	    'new_item' 		 => _x( 'Nueva Propiedad', 'propiedad', 'wpcasa' ),
       	    'view_item' 		 => _x( 'Ver Propiedad', 'propiedad', 'wpcasa' ),
       	    'search_items' 	 => _x( 'Buscar Propiedades', 'propiedades', 'wpcasa' ),
       	    'not_found' 		 => _x( 'No se encontraron propiedades', 'propiedades', 'wpcasa' ),
       	    'not_found_in_trash' => _x( 'No se encontraron propiedades en el basurero', 'propiedades', 'wpcasa' ),
       	    'menu_name' 	 => _x( 'Propiedades', 'propiedades', 'wpcasa' ),
       	);
   
       	return $labels;
   
       }
       ```
   
 * I can see labels changing so I am sure the code is working, but this is having
   no impact on the actual post type name (the url). So all properties are being
   listed under:
 * [http://mywebsite.com/listing/property-name](http://mywebsite.com/listing/property-name)
 * I am hoping to change “listing” in the url for something different like:
 * [http://mywebsite.com/propiedades/property-name](http://mywebsite.com/propiedades/property-name)
 * Hopefully that makes sense.
 * Thanks!
 *  Plugin Author [WPSight](https://wordpress.org/support/users/wpsight/)
 * (@wpsight)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/post-type-name-changeable/#post-7251951)
 * The given code was indeed just for the labels. If you want to change the slug,
   you need to apply another filter:
 *     ```
       /**
        * Custom listing slug
        */
       add_filter( 'wpsight_rewrite_listings_slug', 'my_rewrite_listings_slug' );
   
       function my_rewrite_listings_slug( $slug ) {
   
       	$slug = 'propiedades';
   
       	return $slug;
   
       }
       ```
   
 * After adding this code you will have to save your permalinks on _WP-Admin > Settings
   > Permalinks_ to update the rewrite rules.
 * Regarding the labels… if you _just_ want to translate, I recommend to work with
   plugin translations. Spanish is included. We use the term anuncio but you can
   easily change that to your needs using [Loco Translate](https://wordpress.org/plugins/loco-translate/)
   in your WordPress admin or [Poedit](https://poedit.net/wordpress) as a desktop
   tool.
 * Hope this helps.
 *  Thread Starter [redstormj](https://wordpress.org/support/users/redstormj/)
 * (@redstormj)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/post-type-name-changeable/#post-7251966)
 * Massive thanks! this is much appreciated. Works as expected.

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

The topic ‘Post Type name changeable?’ is closed to new replies.

 * ![](https://ps.w.org/wpcasa/assets/icon-256x256.png?rev=3511685)
 * [WPCasa - Real Estate for WordPress](https://wordpress.org/plugins/wpcasa/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpcasa/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpcasa/)
 * [Active Topics](https://wordpress.org/support/plugin/wpcasa/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpcasa/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpcasa/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [redstormj](https://wordpress.org/support/users/redstormj/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/post-type-name-changeable/#post-7251966)
 * Status: resolved