# Change the Menu Icon and Position of Any Post Type

> Gives a post type registered by a plugin or theme a different Dashicon and moves it up or down the admin menu.

- Type: PHP
- Runs: Run everywhere
- Category: [Custom Post Types & Fields](https://wpide.com/library/category/post-types/)
- Tags: admin-menu, icons, custom-post-types
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/post-type-menu-icon-position/

## Code

```php
// Post type => icon and menu position.
$wpide_menu_tweaks = array(
    'portfolio' => array( 'icon' => 'dashicons-art', 'position' => 6 ),
);

add_filter( 'register_post_type_args', function ( $args, $post_type ) use ( $wpide_menu_tweaks ) {
    if ( isset( $wpide_menu_tweaks[ $post_type ] ) ) {
        $args['menu_icon']     = $wpide_menu_tweaks[ $post_type ]['icon'];
        $args['menu_position'] = (int) $wpide_menu_tweaks[ $post_type ]['position'];
    }

    return $args;
}, 10, 2 );
```

## Notes

Pick icons at developer.wordpress.org/resource/dashicons. Positions: 5 below Posts, 20 below Pages, 60 below Appearance.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Change the Menu Icon and Position of Any Post Type" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
