# Remove Dashicons for Logged-Out Visitors

> Stops the Dashicons icon font from loading on the front end for visitors, saving a request. Logged-in users still get it for the admin bar.

- Type: PHP
- Runs: Frontend only
- Category: [Performance](https://wpide.com/library/category/performance/)
- Tags: performance, dashicons, css
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/remove-dashicons-for-visitors/

## Code

```php
add_action( 'wp_enqueue_scripts', function () {
    if ( ! is_user_logged_in() ) {
        wp_dequeue_style( 'dashicons' );
    }
}, 100 );
```

## Notes

If your theme uses Dashicons, they are still loaded as a dependency.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Remove Dashicons for Logged-Out Visitors" 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/
