---
title: "How to Hide an Account Menu Item"
source: "https://docs.nexcess.com/software/kadence/iconic/woocommerce-account-pages/hide-an-account-menu-item/"
description: "Sometimes you may want to hide an item from the account menu. We have a filter to make this possible. Hide a menu item for all users Add the following code to y…"
vertical: "Software"
area: "WooCommerce Account Pages"
date: "2021-03-25"
last_modified: "2026-07-02"
---

# How to Hide an Account Menu Item

Sometimes you may want to hide an item from the account menu. We have a filter to make this possible.

## Hide a menu item for all users

Add the following code to your theme’s `functions.php` file.

```
/**
 * Hide an account menu item.
 * 
 * @param array $hidden
 *
 * @return array
 */
function iconic_hidden_pages( $hidden ) {
	$hidden[] = 'example-page';

	return $hidden;
}

add_filter( 'iconic_wap_hidden_pages', 'iconic_hidden_pages', 10, 1 );
```

The filter accepts 1 parameter:

- `$hidden` This is an array of page slugs. In this example we’re adding `example-page` as a hidden item.

![adding a hidden menu item](https://docs.nexcess.com/wp-content/uploads/2026/06/adding-a-hidden-menu-item.png)

This page will now be hidden from the menu. You can add more pages by duplicating this line `$hidden[] = 'example-page';`.

## Hide a menu item for a specific user role

If you want to hide a menu item from a specific user role, you can do the following:

```
/**
 * Hide an account menu item.
 *
 * @param array $hidden
 *
 * @return array
 */
function iconic_hidden_pages( $hidden ) {
	if ( iconic_get_current_user_role() === 'wholesale' ) {
		$hidden[] = 'example-page';
	}

	return $hidden;
}

add_filter( 'iconic_wap_hidden_pages', 'iconic_hidden_pages', 10, 1 );

/**
 * Get current user role.
 * 
 * @return bool|string
 */
function iconic_get_current_user_role() {
	if( is_user_logged_in() ) {
		$user = wp_get_current_user();
		$role = ( array ) $user->roles;
		return $role[0];
	} else {
		return false;
	}
}
```

The code is much the same as before, except this time we’re using `iconic_get_current_user_role()` to determine if the user has the `wholesale` role. If they do, we’ll hide the `example-page` menu item.
