Last Updated: February 25, 2016
·
812
· derekshirk

Change default WordPress menu names

This is a helpful function I have been using to easily change the names of default menu items such as Posts or Media. I mainly use this to change the name of 'Posts' to something else such as 'News' which I used in this example:

function menu_item_text( $menu ) {
$menu = str_ireplace( 'Posts', 'News', $menu );
return $menu;
}
add_filter('gettext', 'menu_item_text');
add_filter('ngettext', 'menu_item_text');

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Related Tags
#wordpress
Did you know?

WordPress sites collect scripts from themes, plugins, and tag managers. A compromised plugin update can add a skimmer to every page without a change in your own templates.

Security insights from Cside