# Turn Off Avatars in the Dashboard Only

> Stops wp-admin from loading an avatar for every row of the comments and users screens and the dashboard, which saves dozens of requests to Gravatar, while avatars keep showing on the front of the site.

- Type: PHP
- Runs: Admin only
- Category: [Performance](https://wpide.com/library/category/performance/)
- Tags: avatars, admin, gravatar
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/perf-no-avatars-in-admin/

## Code

```php
add_filter( 'pre_option_show_avatars', function ( $value ) {
    if ( ! is_admin() || wp_doing_ajax() ) {
        return $value;
    }

    $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;

    if ( $screen && $screen->is_block_editor() ) {
        return $value;
    }

    return '0';
} );
```

## Notes

The block editor and front-end comment lists are not affected.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Turn Off Avatars in the Dashboard Only" 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/
