Ever wanted to rename wp-admin menu items in WordPress? You can by adding the following code to your theme’s functions.php file:
https://gist.github.com/2044734
You can add multiple changes by copying this line and changing Dashboard and Home:
$menu = str_ireplace( ‘Dashboard’, ‘Home’, $menu );
Note: This will replace all references to Dashboard to Home so you could use this to rename other stuff. For instance, you can rebrand WooCommerce to DaanShop, which, ofcourse, is way cooler ๐
Handig! Bedankt voor het delen.
Working perfectly. Thanks Mr. Daan
Hey Daan
Thanks for the code. It works for the standard menu items. But not with the ones of the Croma Bistro theme, that I want to change like: menus, reservation, locations, promotions…. Any idea?
Thanks for your help.
Michael
The menu items are probably not set in translatable strings. More info here: http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
dan,
thanks. this was what I was looking for.
Do you know if this has any effect when the theme is being translated via wpml?
I know they have menu and string translators in that plugin – just wondering if this has any negative effects.
Thanks again.
I haven’t tested it against WPML but you may be right. Go ahead and test it ๐
thank you Daan this was really helpful!
This is great!
But how to achieve for menus created by plugins or theme frameworks?
Some plugins add menu items without translatable strings. In that case you are out of luck.
More info here: http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
PS: Are you going to WordCamp Oslo? Say hi from me to team there ๐
How does this work with sub menus?
It should work if the strings are i18n.
Some reading:
http://codex.wordpress.org/I18n_for_WordPress_Developers
http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
http://codex.wordpress.org/Function_Reference/_n
Ah I see, thanks!
you rock !
Thanks ๐
Thanks for this great tutorial man.. It really works. But how about the menu names created by pluings? I have a menu item ‘News Headlines’ and I wish to rename it as ‘Notice’. Using this snippet, it does not work at all. Any idea how can I execute this? Thanks once again.
It should work if the strings are i18n. If they are not, you can’t change them with this method.
Some reading:
http://codex.wordpress.org/I18n_for_WordPress_Developers
http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
http://codex.wordpress.org/Function_Reference/_n
Hi Daan,
Awesome work brother! Any idea on how to change submenu item names?