WPSurfer.com

How to Disable Dashicons in WordPress

Published on September 24, 2022 | Updated on December 21, 2022

In WordPress, Dashicons are a set of icons used within the WordPress admin dashboard.

By default, they’re loaded on both the frontend and backend, even though they’re only typically visible to logged-in users

If your site doesn’t rely on these icons on the frontend, you can improve your site’s loading speed by disabling Dashicons for visitors who aren’t logged in as admins.

Here’s a quick guide on how to do it.

To disable the dashicons in WordPress, you can add the following code to your theme’s functions.php file:

add_action( 'wp_enqueue_scripts', 'dequeue_dashicon' );
function dequeue_dashicon() {
    if ( current_user_can( 'update_core' ) ) {
        return;
    }
    wp_deregister_style( 'dashicons' );
}
Manuel Campos

Manuel Campos

I am José Manuel. I am writing about things I know and things that I am learning about WordPress. I hope you find the content of this blog useful.