WordPress

Remove WordPress dashicons.min.css

On your WordPress site, the dashicons.min.css code is the CSS file of the toolbar displayed for users logged into your site. You can follow the instructions below to remove dashicons.min.css. When you add the dashicons.min.css removal code to your theme’s function.php file, dashicons.min.css will only be visible to those logged in as admin.

What is dashicons.min.css used for?

The dashicons.css code is the CSS file for the toolbar displayed to users who log in to your site.

It is also a necessary CSS file in the admin panel.

Why should we remove dashicons.min.css?

This CSS file is visible on all pages as standard on WordPress sites.

dashicons CSS file is only used by users who are logged into your site. But WordPress shows this code to everyone who visits your site as standard.

Showing the code to everyone will decrease your site speed and Google Page Speed ​​score.

remove dashicons.min.css

  • Open your theme’s function.php file.
  • Add the following codes to the bottom line, save them and send them back to your server.
/* dashicons.min.css visible to admin only */
add_action( 'wp_print_styles', 'tn_dequeue_dashicons_style' );
function tn_dequeue_dashicons_style() { 
wp_dequeue_style( 'dashicons' );
}
/* #dashicons.min.css visible to admin only */

Leave a Comment

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

Scroll to Top