# Rename a Plugin's Post Type

> Changes the name a theme or plugin gave its post type everywhere in the admin, for example "Projects" to "Case Studies", without touching URLs or content.

- Type: PHP
- Runs: Run everywhere
- Category: [Custom Post Types & Fields](https://wpide.com/library/category/post-types/)
- Tags: labels, admin, custom-post-types
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/rename-post-type-labels/

## Code

```php
// Post type and its new names.
$wpide_relabel = array(
    'post_type' => 'portfolio',
    'singular'  => 'Case Study',
    'plural'    => 'Case Studies',
);

add_filter( 'register_post_type_args', function ( $args, $post_type ) use ( $wpide_relabel ) {
    if ( $wpide_relabel['post_type'] !== $post_type ) {
        return $args;
    }

    $s = $wpide_relabel['singular'];
    $p = $wpide_relabel['plural'];

    $args['label']  = $p;
    $args['labels'] = array_merge( (array) ( $args['labels'] ?? array() ), array(
        'name'          => $p,
        'singular_name' => $s,
        'menu_name'     => $p,
        'all_items'     => "All $p",
        'add_new_item'  => "Add New $s",
        'edit_item'     => "Edit $s",
        'new_item'      => "New $s",
        'view_item'     => "View $s",
        'view_items'    => "View $p",
        'search_items'  => "Search $p",
        'archives'      => "$s Archives",
    ) );

    return $args;
}, 10, 2 );
```

## Notes

Only the labels change; use the slug snippet to change URLs as well.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Rename a Plugin's Post Type" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
