{"id":1823,"date":"2024-12-17T10:47:10","date_gmt":"2024-12-17T09:47:10","guid":{"rendered":"https:\/\/wpmastertoolkit.com\/module\/desactiver-les-fichiers-css-et-js-dashicons\/"},"modified":"2025-01-02T17:03:54","modified_gmt":"2025-01-02T16:03:54","slug":"desactiver-les-fichiers-css-et-js-dashicons","status":"publish","type":"module","link":"https:\/\/wpmastertoolkit.com\/en\/module\/disable-dashicons-css-and-js-files\/","title":{"rendered":"Disabling CSS and JS dashicons"},"content":{"rendered":"<h1 class=\"wp-block-heading\">Disable CSS and JS Dashicon files with WPMasterToolKit<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress automatically loads Dashicon files (CSS and JS) on every page of your site, even when they're not needed. These files, while useful for the admin interface and logged-in users, add unnecessary requests for offline visitors, which can slow down your site. The module <strong>Disable Dashicons CSS and JS files<\/strong> from WPMasterToolKit lets you disable these files for offline users, optimizing your site's performance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why disable Dashicons for visitors?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Dashicons is an icon font used by WordPress in the administration and some extensions. However, it's often not necessary for the front-end of your site. Here's why you might want to disable Dashicons:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Performance enhancement<\/strong> Each additional HTTP request can slow down page loading, especially on high-traffic sites.<\/li>\n\n\n\n<li><strong>Optimizing resources<\/strong> : By deleting Dashicons for visitors who are not logged in, you reduce the total weight of your pages.<\/li>\n\n\n\n<li><strong>Preserving minimalist styles<\/strong> : If your theme or plugins don't use Dashicons on the front-end, there's no need to load these files.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">How the Disable Dashicons CSS and JS files module works<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The module <strong>Disable Dashicons CSS and JS files<\/strong> is designed to identify situations where Dashicons is not needed, and disable it accordingly. Here's how it works:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Deactivation for offline users<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Dashicon CSS and JS files are only removed for visitors who are not logged in. This ensures that administrators or authenticated users continue to benefit from Dashicons in the dashboard.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Dashicons maintained on sensitive pages<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Login pages<\/strong> Dashicons remain active on pages such as <code data-no-auto-translation=\"\">wp-login.php<\/code>They depend on it to display icons correctly.<\/li>\n\n\n\n<li><strong>Protected pages<\/strong> If a specific page requires Dashicons (for example, a protected page with a special view), the module leaves them enabled.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Using WordPress hooks<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The module uses hooks <code data-no-auto-translation=\"\">wp_dequeue_style<\/code> and <code data-no-auto-translation=\"\">wp_deregister_style<\/code> to delete Dashicon files. These actions are applied only when the file is superfluous, avoiding any impact on administration or specific pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to use this module<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Installation<\/strong> : Install and activate the plugin <strong>WPMasterToolKit<\/strong> on your WordPress site.<\/li>\n\n\n\n<li><strong>Module activation<\/strong> Go to the list of modules and activate \"Disable Dashicons CSS and JS files\".<\/li>\n\n\n\n<li><strong>Automation<\/strong> Once activated, the module works automatically, disabling Dashicons for offline visitors while maintaining their availability for administrators.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Our technical choices for this module<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Targeted approach<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We've designed this module to disable Dashicons only when relevant:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Offline visitors benefit from a faster user experience.<\/li>\n\n\n\n<li>Logged-in users are not affected, retaining a fully functional dashboard.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Lightweight and efficient<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The module uses minimalist code based on native WordPress hooks. This guarantees compatibility with future versions of WordPress while minimizing the impact on site performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enhanced safety<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">All checks, such as identifying login pages or protected pages, are carried out using secure methods, such as <code data-no-auto-translation=\"\">sanitize_text_field<\/code> and <code data-no-auto-translation=\"\">strpos<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The module <strong>Disable Dashicons CSS and JS files<\/strong> from WPMasterToolKit is an ideal solution for optimizing the performance of your WordPress site. By removing useless Dashicon files for offline visitors, it reduces HTTP requests and speeds up page loading. Try it today and enjoy a faster, more optimized site!<\/p>","protected":false},"excerpt":{"rendered":"<p>Optimize the performance of your WordPress site with WPMasterToolKit's Disable Dashicons CSS and JS files module. This module automatically disables unnecessary Dashicon files for offline visitors, reducing HTTP requests and speeding up page loading. A simple solution for a faster, more efficient site!<\/p>","protected":false},"featured_media":0,"parent":0,"template":"","meta":{"_acf_changed":true,"_seopress_titles_title":"Boostez votre site WordPress : D\u00e9sactivez Dashicons inutiles","_seopress_titles_desc":"Am\u00e9liorez la vitesse de votre site en d\u00e9sactivant Dashicons pour les visiteurs non connect\u00e9s avec WPMasterToolKit. R\u00e9duisez les requ\u00eates inutiles.","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"both","_seopress_redirections_param":"","_seopress_redirections_type":301,"_seopress_analysis_target_kw":"","_seopress_news_disabled":"","_seopress_video_disabled":"","_seopress_video":[],"_seopress_pro_schemas_manual":[],"_seopress_pro_rich_snippets_disable_all":"","_seopress_pro_rich_snippets_disable":[],"_seopress_pro_schemas":[],"_surecart_dashboard_logo_width":"180px","_surecart_dashboard_show_logo":true,"_surecart_dashboard_navigation_orders":true,"_surecart_dashboard_navigation_invoices":true,"_surecart_dashboard_navigation_subscriptions":true,"_surecart_dashboard_navigation_downloads":true,"_surecart_dashboard_navigation_billing":true,"_surecart_dashboard_navigation_account":true},"class_list":["post-1823","module","type-module","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module\/1823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module"}],"about":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/types\/module"}],"wp:attachment":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/media?parent=1823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}