# Separate Favicon for the Admin Area

> Uses a different browser tab icon in wp-admin than on the public site, so admin tabs are easy to spot among the others.

- Type: PHP
- Runs: Admin only
- Category: [Admin](https://wpide.com/library/category/admin/)
- Tags: admin, favicon, branding
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/separate-admin-favicon/

## Code

```php
// Full URL of the icon (PNG, SVG or ICO). Upload it to the Media Library and paste its URL.
$wpide_admin_favicon = 'https://example.com/wp-content/uploads/admin-icon.png';

add_action( 'admin_init', function () {
    remove_action( 'admin_head', 'wp_site_icon' );
} );

add_action( 'admin_head', function () use ( $wpide_admin_favicon ) {
    if ( $wpide_admin_favicon ) {
        echo '<link rel="icon" href="' . esc_url( $wpide_admin_favicon ) . '">' . "\n";
    }
} );
```

## Notes

A different icon per environment (for example red on staging) helps prevent editing the wrong site.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Separate Favicon for the Admin Area" 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/
