Sometime you may need to change the default label “Posts” with your required word, like Portfolio, Articles, News, etc. WordPress is a very powerful CMS that gives you the ability to play with it.
Rename default label “Posts” – In Admin Left Menu
Here, I am using wordpress hook (add_action) to change “Posts” to “News”. Add these functions in your current theme’s functions.php file.
$menu = 'News';
$submenu['edit.php'] = 'News';
$submenu['edit.php'] = 'Add News';
$submenu['edit.php'] = 'News Tags';
add_action( 'admin_menu', 'tv_change_post_label' );
With above function you will see only left menu labels are changed.
Rename default label “Posts” Object
To change Post object labels you need to update $wp_post_types object and that function should be call on init. i.e.
$labels = &$wp_post_types['post']->labels;
$labels->name = 'News';
$labels->singular_name = 'News';
$labels->add_new = 'Add News';
$labels->add_new_item = 'Add News';
$labels->edit_item = 'Edit News';
$labels->new_item = 'News';
$labels->view_item = 'View News';
$labels->search_items = 'Search News';
$labels->not_found = 'No News found';
$labels->not_found_in_trash = 'No News found in Trash';
$labels->all_items = 'All News';
$labels->menu_name = 'News';
$labels->name_admin_bar = 'News';
add_action( 'init', 'tv_change_post_object' );
If you use only above function, You will see the it changed new lable “News” but “Tags” is still single word.
To make changes on both please use both functions. Here is the fully snippet for WordPress: Rename the default label “Posts” to “News” OR something else…
Source: My GitHub Account
When you use both functions you will see that your “Posts” label has been changed to “News” like: