How to rename WooCommerce admin menu on WordPress dashboard

In this tutorial, I will show you how you can rename the Woocommerce admin menu on the WordPress dashboard.

Quick Tip : Add Custom Post Types To At A Glance Dashboard Widget In WordPress

To change the menu name copy the following code snippet and paste it inside your functions.php file.

Note: Change Store Settings with your own custom name.

add_action( 'admin_menu', 'rename_woocoomerce_wpse_100758', 999 );

function rename_woocoomerce_wpse_100758() 
{
    global $menu;

    // Pinpoint menu item
    $woo = recursive_array_search_php_91365( 'WooCommerce', $menu );

    // Validate
    if( !$woo )
        return;

    $menu[$woo][0] = 'Store Settings';
}

function recursive_array_search_php_91365( $needle, $haystack ) 
{
    foreach( $haystack as $key => $value ) 
    {
        $current_key = $key;
        if( 
            $needle === $value 
            OR ( 
                is_array( $value )
                && recursive_array_search_php_91365( $needle, $value ) !== false 
            )
        ) 
        {
            return $current_key;
        }
    }
    return false;
}

Source: WordPress Stack Exchange

6 Comments

  1. This is handy! Just tried it now and it works. Thumbs up for the useful snippets. 🙂 One question, any particular reason why the functions end with a bunch of numbers?

    Reply
    • To rename, Products replace WooCommerce with Products in the following line.

      $woo = recursive_array_search_php_91365( 'WooCommerce', $menu );
      

      To change submenus use,

      global $submenu
      
      Reply

Leave a Comment.