Its most required and desired functionality needed in word press when we create a custom post type and we need to change the slug accordingly so following lines in custom post type declaration helps
'rewrite' => array('slug'=>'csj'),
We had a custom post type with a slug ‘justice-cpt’ but on single page the URL’s needed to have just ‘csj’
![Change the Slug of a Custom Post Type [CPT] 1 screen27](https://i0.wp.com/unbeatenwebsolutions.com/wp-content/uploads/2024/07/screen27.jpg?resize=640%2C345&ssl=1)
As seen in back end
![Change the Slug of a Custom Post Type [CPT] 2 screen28](https://i0.wp.com/unbeatenwebsolutions.com/wp-content/uploads/2024/07/screen28.jpg?resize=440%2C78&ssl=1)
As seen on front end
![Change the Slug of a Custom Post Type [CPT] 3 screen29](https://i0.wp.com/unbeatenwebsolutions.com/wp-content/uploads/2024/07/screen29.jpg?resize=228%2C63&ssl=1)