Rename "Posts" to "Articles"
Changes every label of the built-in Posts type in the admin, such as the menu, buttons and messages, to a name that fits your site.
Opens WPIDE on
Code
// The new names for posts.
$wpide_post_singular = 'Article';
$wpide_post_plural = 'Articles';
add_filter( 'post_type_labels_post', function ( $labels ) use ( $wpide_post_singular, $wpide_post_plural ) {
$one = $wpide_post_singular;
$many = $wpide_post_plural;
$low = strtolower( $many );
$new = array(
'name' => $many,
'singular_name' => $one,
'add_new_item' => "Add New $one",
'edit_item' => "Edit $one",
'new_item' => "New $one",
'view_item' => "View $one",
'view_items' => "View $many",
'search_items' => "Search $many",
'not_found' => "No $low found.",
'not_found_in_trash' => "No $low found in Trash.",
'all_items' => "All $many",
'archives' => "$one Archives",
'attributes' => "$one Attributes",
'insert_into_item' => "Insert into $one",
'uploaded_to_this_item' => "Uploaded to this $one",
'filter_items_list' => "Filter $low list",
'items_list' => "$many list",
'item_published' => "$one published.",
'item_updated' => "$one updated.",
'item_scheduled' => "$one scheduled.",
'item_reverted_to_draft' => "$one reverted to draft.",
'menu_name' => $many,
'name_admin_bar' => $one,
);
foreach ( $new as $key => $value ) {
$labels->$key = $value;
}
return $labels;
} );
Notes
Only labels change; URLs, the post type name and existing content stay the same.
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.