How to disable the dash icon in WordPress without plugin?

In this article, I will show you How to disable the Dash icon on the WordPress website without any plugin and improve the blog loading speed.

Dash Icon is a stylesheet loaded by WordPress to show icons in various places such as the Admin bar. But, Most WP sites don’t use it except for the admin bar. So, it is not required for the website when the user is not logged in.

So, You can safely disable it for the logged-out users and improve the page speed performance.

When you check the website in page speed insight, You will notice this Dashicon error.

PageSpeed Insights Report

Dash icon in WordPress causes both “Reduce unused CSS” and “Eliminate Render blocking resources” errors.

You can easily fix this issue in WordPress by following the steps.

Steps to Disable Dashicon in WordPress

To disable the Dash icon in WordPress without a plugin, follow the steps.

1. Log in to the WordPress dashboard.

2. Now Go to the Appearance > Theme file editor.

3. Here, Open the Theme functions (function.php) file.

4. Scroll down till the end and paste the below code on it.

WordPress theme editor
function wpdocs_dequeue_dashicon() {
        if (current_user_can( 'update_core' )) {
            return;
        }
        wp_deregister_style('dashicons');
}
add_action( 'wp_enqueue_scripts', 'wpdocs_dequeue_dashicon' );

5. Now Hit the Update button and the Dash icon will disabled on your WordPress website without using any plugin.

Note: Follow the steps carefully, if you accidentally remove or modify any existing code in the function.php then your site may break or don’t work as intended. So, do it carefully. It is recommended to take a backup of the file before modifying it.

if you don’t want to edit the function file, then you can use a code manager plugin as well.

Go to Plugins > Add New and search for the plugin Like “code manager”.

Now, Install and activate the WP code plugin.

WPCode Plugin

In the next Step, Go to the Plugin settings, and click on the Add Snippet option.

code snippet plugin setting

Now select the Custom Code (New Snippet) option, Paste the above-provided code, and make sure to select the code type to PHP snippet.

Create Custom Snippet

Now click on the Activate and save the snippet.

You have successfully disabled the Dash icon on your WordPress website.

Alternatively, if you are using Plugins like Perfmatters then you can also do that with a single click.

Perfmatters

Just Go to the settings > Perfmatters and you will see the option to disable the dash icon at the top.

Just Enable the toggle and save the settings. That’s it your Website won’t load the Dash icon stylesheet from now and it will only load for logged-in users like Admin, Editor, and Author of your website.

Perfmatters General Setting

In this way, You can Block the unused CSS and solve the error of the Rederblocking resource on your website.

If you have any doubts, regarding WordPress performance, feel free to ask in the comment section.

Leave a Reply

Discover more from Bloguplift

Subscribe now to keep reading and get access to the full archive.

Continue reading