WooCommerce PHP Beginner Requires WooCommerce

Remove or Rename My Account Menu Items

Remove tabs like Downloads from the WooCommerce My Account menu and rename others.

Tested on WordPress 7.1 PHP 8.3 Updated
functions.php 11 lines
add_filter( 'woocommerce_account_menu_items', function ( array $items ): array {
	// Remove a tab.
	unset( $items['downloads'] );

	// Rename a tab.
	if ( isset( $items['edit-address'] ) ) {
		$items['edit-address'] = 'Addresses';
	}

	return $items;
} );

Where to add this

Recommended A code snippets plugin Survives theme changes and is easy to switch off.
Child theme At the end of your child theme's functions.php file.
Must-use plugin As a .php file in wp-content/mu-plugins, starting with <?php.

Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.

If you don’t sell downloads, the Downloads tab in My Account is just an empty page. This snippet removes tabs you don’t need and renames others.

How it works

The woocommerce_account_menu_items filter holds the menu as endpoint => label pairs: dashboard, orders, downloads, edit-address, payment-methods, edit-account and customer-logout. Remove a key to hide the tab or change a value to rename it.

Things to watch

  • Removing a tab hides the link, but the page still works if someone visits its URL. To disable it completely, also clear the endpoint under WooCommerce → Settings → Advanced → Account endpoints.
  • Don’t remove Log out.

How to test it

Log in as a customer and open My Account. Downloads should be gone and Addresses should be renamed.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only