How to Remove Dashicons and Improve WordPress Performance

If you’ve run your site through a PageSpeed report, you might have noticed a file called:

/wp-includes/css/dashicons.min.css?ver=6.4.3

It’s a small CSS file, but every request adds up when it comes to performance. The good news? You can safely remove it for visitors who don’t need it.


Why Are Dashicons Loading on the Front End?

Dashicons are WordPress’ default icon font, used throughout the admin dashboard. They power many of the little icons you see in menus and the WordPress admin bar (the toolbar that shows up at the top of your site when you’re logged in).

The problem: by default, WordPress loads dashicons.min.css for all visitors—even those who aren’t logged in and don’t see the admin bar. That means your regular site visitors are downloading extra CSS they’ll never use.


How to Remove Dashicons for Non-Logged-In Users

To prevent Dashicons from loading for your visitors, but keep them for logged-in users (like site admins), just add the following snippet to your theme’s functions.php file:

/**
* Deregister Dashicons on the front end for non-logged-in users
*/

add_action( 'wp_enqueue_scripts', 'my_deregister_styles', 100 );
function my_deregister_styles()
{
if ( ! is_user_logged_in() )
{

wp_deregister_style( 'dashicons' );
}
}

What this does:

  • Checks if the visitor is logged in

  • If they’re not logged in, WordPress skips loading the dashicons.min.css file

  • If they are logged in, nothing changes—admins still see their icons as usual


Will This Break My Icons?

No. Logged-in users will continue to see all Dashicons in the dashboard and admin bar, exactly as before.

This only affects visitors who aren’t logged in to WordPress—which means they won’t see those admin features or icons anyway.


How Big Is the Impact?

The dashicons.min.css file is around 61 KB uncompressed, and typically much smaller when served compressed. On its own, it’s not huge, but if you’re trying to optimize every request (especially on mobile or slower networks), it makes sense to remove it.

If you’re already running a performance plugin like WP Rocket or Perfmatters, this file may already be handled for you. In fact, in future versions of WordPress, Dashicons may not load on the front end at all.

Still, for many sites today, manually removing it ensures you’re not serving unnecessary CSS to visitors.


Final Thoughts

Removing Dashicons from the front end is a quick and easy win for WordPress performance. It only takes one line of code, doesn’t break anything for logged-in users, and keeps your site a little bit leaner.

While the speed gains won’t be massive on their own, optimizing these small details across your site adds up to a noticeably faster experience for your visitors.

If you’re serious about speed, removing unneeded assets like this is an easy step in the right direction.

Written by

Related Posts

No Results Found

The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *