Rename WooCommerce in admin dashboard menu

When setting up a WooCommerce store, you might find yourself looking for a way to rename the WooCommerce label in WordPress admin dashboard to something else. There are different cases in which you’d need to make such a change, for me it was because I needed to hide WooCommerce reference from a custom user role I’ve set up to manage orders on a client project.

Without further ado…

The process is actually pretty simple. We’ll use the action hook `admin_menu` to pinpoint WooCommerce reference in the global array`$menu`, then we’ll modify it.

Here is the full code, just place it in your child theme’s functions.php file and modify as needed.

add_action( 'admin_menu', 'ak_rename_woocommerce_dashboard_menu', 999 );
function ak_rename_woocommerce_dashboard_menu() {

    global $menu;
    // Replace this with your custom name
    $new_name = 'New Name';
    // Find WooCommerce reference and change it
    foreach($menu as $key => $item){
        if(isset($item[0]) && $item[0] == 'WooCommerce'){
            $menu[$key][0] = $new_name;
            break;
        }
    }

}

Leave a comment