How To Change The WordPress Default Post Type Labels

If you have ever wondered if you can change the default WordPress post type labels like View Post or Edit Post then you’re in luck because it’s actually really easy.

Why would you want to do this instead of creating a custom post type? Some people simply want to call “posts” something else and this is the most direct way without introducing the overhead of adding an additional post type into your WordPress setup.

In the example below I have changed the default Posts post type to Articles:

add_action( 'init', 'custom_change_post_type_labels' );

// Change Posts to Articles
function custom_change_post_type_labels() {
    $post_type = get_post_type_object('post');
    $labels = $post_type->labels;
    $labels->name = 'Articles';
    $labels->singular_name = 'Article';
    $labels->add_new = 'Add Article';
    $labels->add_new_item = 'Add Article';
    $labels->edit_item = 'Edit Article';
    $labels->new_item = 'Article';
    $labels->view_item = 'View Article';
    $labels->search_items = 'Search Articles';
    $labels->not_found = 'No Articles found';
    $labels->not_found_in_trash = 'No Articles found in Trash';
    $labels->all_items = 'All Articles';
    $labels->menu_name = 'Articles';
    $labels->name_admin_bar = 'Articles';
}

As you can see, it’s really just a matter of grabbing the post type object and changing the $labels object to fit your needs.

Function references: