Rename "Posts" to "Articles" in the Admin
Changes the labels of the built-in Posts type to "Articles" across the admin menu, screens and editor, for sites where "posts" means something else.
Opens WPIDE on
Code
add_filter( 'post_type_labels_post', function ( $labels ) {
$singular = 'Article';
$plural = 'Articles';
$map = array(
'name' => $plural,
'singular_name' => $singular,
'add_new_item' => 'Add New ' . $singular,
'edit_item' => 'Edit ' . $singular,
'new_item' => 'New ' . $singular,
'view_item' => 'View ' . $singular,
'view_items' => 'View ' . $plural,
'search_items' => 'Search ' . $plural,
'not_found' => 'No ' . strtolower( $plural ) . ' found.',
'not_found_in_trash' => 'No ' . strtolower( $plural ) . ' found in Trash.',
'all_items' => 'All ' . $plural,
'archives' => $singular . ' Archives',
'attributes' => $singular . ' Attributes',
'insert_into_item' => 'Insert into ' . strtolower( $singular ),
'uploaded_to_this_item' => 'Uploaded to this ' . strtolower( $singular ),
'filter_items_list' => 'Filter ' . strtolower( $plural ) . ' list',
'items_list' => $plural . ' list',
'item_published' => $singular . ' published.',
'item_updated' => $singular . ' updated.',
'item_scheduled' => $singular . ' scheduled.',
'menu_name' => $plural,
'name_admin_bar' => $singular,
);
foreach ( $map as $key => $value ) {
$labels->$key = $value;
}
return $labels;
} );
Notes
Change $singular and $plural to any wording, for example News / News.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.