{"id":11719,"date":"2022-12-27T13:02:01","date_gmt":"2022-12-27T13:02:01","guid":{"rendered":"https:\/\/nieuw.wpprovider.nl\/remove-font-awesome-from-your-wordpress-theme\/"},"modified":"2022-12-27T13:02:01","modified_gmt":"2022-12-27T13:02:01","slug":"remove-font-awesome-from-your-wordpress-theme","status":"publish","type":"post","link":"https:\/\/nieuw.wpprovider.nl\/en\/remove-font-awesome-from-your-wordpress-theme\/","title":{"rendered":"Remove Font Awesome from your WordPress Theme"},"content":{"rendered":"<p>There are still many themes that automatically load the <a href=\"https:\/\/fontawesome.com\/icons\" target=\"_self\" rel=\"external nofollow noopener\">Font Awesome icons<\/a> and do not give users the option to prevent this.<br \/>\nIf you don&#8217;t need the icons or prefer to load them locally, you should disable loading by the theme.<br \/>\nBelow we explain how this works.    <\/p>\n<div>  But first, we briefly explain what Font Awesome icons actually are, everyone has surely seen them before.  <\/p>\n<h2>What is Font Awesome?<\/h2>\n<p>  Font Awesome is the most widely used toolkit for vector icons that can be easily customized with CSS.<br \/>\nAmong other things, you can change the size and color of the icons, add a drop shadow or use animated loading icons.<br \/>\nAs the name suggests, icons look &#8220;awesome&#8221; according to their own description \ud83d\ude09 In fact, they are a popular style tool to spice up or design a website with icons.    <\/p>\n<figure class=\"wp-block-image aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-5618 size-full\" src=\"https:\/\/nieuw.wpprovider.nl\/wp-content\/uploads\/Fontawesome.png\" alt=\"\" width=\"1247\" height=\"419\" srcset=\"https:\/\/nieuw.wpprovider.nl\/wp-content\/uploads\/Fontawesome.png 1247w, https:\/\/nieuw.wpprovider.nl\/wp-content\/uploads\/Fontawesome-300x101.png 300w, https:\/\/nieuw.wpprovider.nl\/wp-content\/uploads\/Fontawesome-1024x344.png 1024w, https:\/\/nieuw.wpprovider.nl\/wp-content\/uploads\/Fontawesome-768x258.png 768w\" sizes=\"(max-width: 1247px) 100vw, 1247px\" \/><\/figure>\n<h2>Disable automatic loading of Font Awesome<\/h2>\n<p>  Reasons to disable automatic loading from a remote server could include performance improvement and, of course, GDPR compliance.<br \/>\nFirst of all, you should find out which handle the stylesheet is called with.<br \/>\nTo do this, look in the <em>functions.php<\/em> of the theme, you should look for the term <em>font-awesome<\/em> or <em>fontawesome<\/em> in connection with the call <em>wp_enqueue_style<\/em> In our theme for the demo, the corresponding line was <\/p>\n<pre class=\"wp-block-code\"><code>wp_enqueue_style('mh-font-awesome', \"\/\/maxcdn.bootstrapcdn.com\/font-awesome\/4.2.0\/css\/font-awesome.min.css\", array(), null);<\/code><\/pre>\n<p> The <em>$handle<\/em> is therefore <em>mh-font-awesome<\/em> In the code reference of wordpress.org you can find more information about the function <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_enqueue_style\/\" target=\"_self\" rel=\"external nofollow noopener\">wp_enqueue_style<\/a> Now, the following code should be inserted in the functions.php of the child theme to prevent loading: <\/p>\n<pre class=\"wp-block-code\"><code>\/\/ Dequeue Styles - Remove Font Awesome from WordPress Theme\nadd_action( 'wp_print_styles', 'dequeue_font_awesome_style' );\nfunction dequeue_font_awesome_style() {\n      wp_dequeue_style( 'mh-font-awesome' );\n      wp_deregister_style( 'mh-font-awesome' );\n}<\/code><\/pre>\n<p> In the code reference from wordpress.org you can find more information about the function <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_dequeue_style\/\" target=\"_self\" rel=\"external nofollow noopener\">wp_dequeue_style<\/a>  <\/p>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are still many themes that automatically load the Font Awesome icons and do not give users the option to prevent this. If you don&#8217;t need the icons or prefer to load them locally, you should disable loading by the theme. Below we explain how this works. But first, we briefly explain what Font Awesome [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10853,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-11719","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-geen-onderdeel-van-een-categorie"],"acf":[],"_links":{"self":[{"href":"https:\/\/nieuw.wpprovider.nl\/en\/wp-json\/wp\/v2\/posts\/11719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nieuw.wpprovider.nl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nieuw.wpprovider.nl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nieuw.wpprovider.nl\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nieuw.wpprovider.nl\/en\/wp-json\/wp\/v2\/comments?post=11719"}],"version-history":[{"count":0,"href":"https:\/\/nieuw.wpprovider.nl\/en\/wp-json\/wp\/v2\/posts\/11719\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nieuw.wpprovider.nl\/en\/wp-json\/wp\/v2\/media\/10853"}],"wp:attachment":[{"href":"https:\/\/nieuw.wpprovider.nl\/en\/wp-json\/wp\/v2\/media?parent=11719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nieuw.wpprovider.nl\/en\/wp-json\/wp\/v2\/categories?post=11719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nieuw.wpprovider.nl\/en\/wp-json\/wp\/v2\/tags?post=11719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}