I've created a custom menu using pages. For a lot of the list items, I've specified a custom menu title for the page... So, the About Us page becomes About on the menu, for example. Then, when the page title is changed, it's changing the title on the menu as well. So if I change About Us to About Our Company the menu is getting changed from About to About Our Company.

Is there a way to change the default in WordPress, so those custom menu titles are the default instead of the page name?

From header.php:

wp_nav_menu( array(
    'theme_location' => 'primary', 
    'sort_column' => 'menu_order', 
    'container_id' => 'nav', 
    'container' => 'div' 
) ); 

From functions.php:

register_nav_menu( 'primary', 'Primary Menu' );
  • I haven't found a way to prevent this, but I notice that it only does it once. For example: 1) Create page called "Hello". 2) Add page to menu. 3) Change page title to "Hello World". 4) Menu label is changed as well. 5) Change menu label back to "Hello". 6) Change page title to "Whatever". 7) Menu label does not change. – MarcGuay Feb 7 '17 at 18:46

Are you in Appearance > Menus? Is that what you mean by custom menu? Can you share the code you are using to make the menu display? I have this in my header:

wp_nav_menu( array('menu' => 'topnav' ));

Where topnav is the name of my custom menu. You have to add the pages to the custom menu in the "Custom Links" area, if you just use the "Pages" and checkboxes, then it will default to the Page title.

Hope this helps!

  • yeah, I'm in appearance > menus. Yes, that's what I meant by custom menu. code is above. I need to be able to add pages, without using the "Custom Links" and have it default to the title I set for it. – Kegan Quimby May 21 '12 at 20:30
  • you could try a custom fields that contains the desired title, then write code to pull that into the menu. But that would be a lot of work, why can't you use "Custom Links"? It would be much easier. – Donna May 22 '12 at 12:47
  • because the custom links don't add the "current-page-ancestor" as a class to the link. I need that so the current link can be styled. – Kegan Quimby May 22 '12 at 13:57
  • This may be of help: blago.net/coding/snippets/… – Donna May 22 '12 at 14:07

Check that the option to Automatically update Top Level Menu Item's isn't selected in the Nav Menu options screen. If that doesn't do it, maybe your menu's aren't registered correctly. Try re-arranging the top level items and see if it changes on the site. If none of that works,try posting the code used to display your custom menu (the header.php code and the functions.php code that registers the menu).

  • none of that worked... posted code above – Kegan Quimby May 21 '12 at 20:29
  • Your code above works for me. I created a basic theme and added your code above and all worked fine. I was able to change a page title in the wp-nav menu and it changed in the menu, but left the page title as set in the page editor. Maybe you have a plug-in causing issues. Try temporarily disabling your plug-ins and see what happens. – Jeremy Jared May 21 '12 at 21:45
  • now change the page title tho, and the menu title should change as well – Kegan Quimby May 21 '12 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.