Most of the time a common error occurs on your website, you have set the font or font awesome icons but they are invisible. Your icons are viewed in a form of squares and the font family which you have set is not working. Icons don’t show up and you are unable to fix this error. For this I am giving you a simple code by which you can easily fix it, follow my below instructions:-

  • First, open your browser developer tool by pressing the f12 key or right click mouse button > Inspect element and go to console.
  • After that check in console if this error is displaying –
  • [code]
    Access to Font at ‘Your site link’ from origin ‘Your site link’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘Your site link’ is therefore not allowed access.
    [/code]

  • Now go to .htaccess file which is your main server configure file, edit the .htaccess file located at the root of your WordPress installation and add this code to the bottom of the file:
  • [code]

    <FilesMatch "\.(ttf|otf|eot)$">
    <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    </IfModule>
    </FilesMatch>
    [/code]


Final Words: –  I hope my tutorial will help you and you will easily fix this error using the code. If you have another query related to this blog just post your comment below.