A while back, I had shown how easily you could remove and reorder WordPress dashboard menu items. Now here I will am going to show how you can rename those menu items to personalize the dashboard for yourself or your clients.
We are going to use gettext
and ngettext
filters to rename menu items. Here’s the function to change label for “Dashboard” and “Posts” menus.
function menu_item_text( $menu ) { $menu = str_ireplace( 'Dashboard', 'Home', $menu ); $menu = str_ireplace( 'Posts', 'Articles', $menu ); return $menu; } add_filter('gettext', 'menu_item_text'); add_filter('ngettext', 'menu_item_text');
Add it to your theme’s functions.php
file and visit your dashboard to see the changes.
Similarly, you can rename all other items as well:
Code:
$menu = str_ireplace( 'Media', 'Your Text', $menu ); $menu = str_ireplace( 'Library', 'Your Text', $menu ); $menu = str_ireplace( 'Links', 'Your Text', $menu ); $menu = str_ireplace( 'Pages', 'Your Text', $menu ); $menu = str_ireplace( 'Comments', 'Your Text', $menu ); $menu = str_ireplace( 'Appearance', 'Your Text', $menu ); $menu = str_ireplace( 'Plugins', 'Your Text', $menu ); $menu = str_ireplace( 'Users', 'Your Text', $menu ); $menu = str_ireplace( 'Tools', 'Your Text', $menu ); $menu = str_ireplace( 'Settings', 'Your Text', $menu );
Just replace highlighted text with what you want as an item’s name. This also works for plugin installed items.