Rename/remove the default “Home” menu link in WordPress Twenty Eleven Theme

If you’re using the “Twenty Eleven” Theme in WordPress and you want to either rename or remove the default “Home” link in your main menu bar, this is what you need to do:

  1. Create a child theme of “Twenty Eleven”. You only need a basic child theme with a default style.css file and an empty functions.php file.
  2. Add the following code to your functions.php file:
add_filter('wp_page_menu_args', 'twentyelevenchild_page_menu_args', 20);

function twentyelevenchild_page_menu_args( $args )
{
    $args['show_home'] = {value};
    return $args;
}Code language: PHP (php)

where {value} is either:

  • “new name” – to give the “Home” link a new custom name, or
  • false – to disable the “Home” link altogether.

It’s possible that this approach will work for other Themes, but I have not tested that – please add a comment if you find out!

This Post Has One Comment

  1. Yannick

    Ok it works but if you enter false, the menu bar is also removed. How can I keep the menu bar but remove the home link?

Leave a Reply