# Quick Links Menu in the Admin Bar

> Adds a "Quick links" dropdown to the admin bar with the outside tools your team opens every day, such as analytics or support.

- Type: PHP
- Runs: Run everywhere
- Category: [Admin](https://wpide.com/library/category/admin/)
- Tags: admin, admin-bar, links
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/admin-bar-quick-links/

## Code

```php
// Label => URL. Links open in a new tab.
$wpide_quick_links = array(
    'Google Analytics' => 'https://analytics.google.com/',
    'Search Console'   => 'https://search.google.com/search-console',
    'Email support'    => 'mailto:support@example.com',
);

add_action( 'admin_bar_menu', function ( $wp_admin_bar ) use ( $wpide_quick_links ) {
    if ( ! current_user_can( 'edit_posts' ) || empty( $wpide_quick_links ) ) {
        return;
    }

    $wp_admin_bar->add_node( array(
        'id'    => 'wpide-quick-links',
        'title' => 'Quick links',
    ) );

    $i = 0;

    foreach ( $wpide_quick_links as $label => $url ) {
        $wp_admin_bar->add_node( array(
            'parent' => 'wpide-quick-links',
            'id'     => 'wpide-quick-link-' . ( ++$i ),
            'title'  => esc_html( $label ),
            'href'   => esc_url( $url ),
            'meta'   => array( 'target' => '_blank', 'rel' => 'noopener noreferrer' ),
        ) );
    }
}, 100 );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Quick Links Menu in the Admin Bar" 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/
