
Have you ever visited your WordPress website only to find that your social media icons in the header or footer are displaying as empty squares instead of the proper Facebook, Twitter, or Instagram icons? This is a common issue, but thankfully, it’s usually easy to fix.
In this guide, we’ll explore the most likely reasons why your social icons are appearing as squares and provide step-by-step solutions to get them working again.
1. Clear Your Cache (Plugin or Server Cache)
Caching plugins like W3 Total Cache, WP Super Cache, or WP Rocket store static versions of your site to improve speed. Sometimes, these cached files prevent updated icons from loading properly.
How to Fix It:
- Clear your cache plugin: Go to Settings > [Your Cache Plugin] and click “Purge Cache.”
- Clear server cache: If your hosting provider (like SiteGround, Bluehost, or Cloudways) has server-level caching, clear it via your hosting dashboard or contact support.
- Clear browser cache: Press Ctrl + F5 (Windows) or Cmd + Shift + R (Mac) to force-refresh the page.
2. Cross Origin Resource Sharing ( CORS )
Your icon font files could be loaded from a URL that has a different domain name structure than your website URL. This will result in Cross Origin Resource Sharing and browsers such as Firefox and Chrome will block your icon font files and prevent them from loading into your browser. This will result in icons showing up as squares. Sometimes your browser blocks font files due to CORS errors — especially when fonts are served from a different domain, subdomain, or CDN.
There is two way to determine whether this is cause by CORS.
- View your website in Safari browser, you will be able to see your Social icons showing up properly. Your Social icons will only show up as squares in Firefox browser and Chrome browser.
- Look into the Console of developer tools such as Firebug for Firefox. You will see an error message similar to the following.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://example.com/wp-content/themes/customizr-pro/inc/assets/css/fonts/fonts/fontawesome-webfont.woff2. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
What causes CORS problems?
- Your WordPress Address (URL) and Site Address (URL) don’t match exactly.
- Your fonts are loaded from a CDN without proper cross-origin permissions.
How to Detect a CORS Issue
- Open your website in Firefox or Chrome, then right-click > Inspect > Console tab.
- Look for error messages like: sqlCopyEdit
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ...
How to Fix It
- Go to Settings > General in your WordPress dashboard.
- Ensure both WordPress Address (URL) and Site Address (URL) match exactly.
- Example:
https://www.example.com
- Not one with
www
and the other without, or one withhttp
and the other withhttps
.
- Example:
Add CORS Header in .htaccess (Advanced)
If you are using a CDN or loading fonts from a different domain (like a subdomain or external URL), you may need to manually allow cross-origin requests.
Add the following to your .htaccess
file:
apacheCopyEdit<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
Note: Only make these changes if you’re comfortable editing .htaccess
. A mistake can crash your site. Contact your web host if you’re unsure.
3. Missing or Broken Icon Files
If your theme uses self-hosted icon fonts (.woff
, .woff2
, .ttf
), they might be missing or corrupted.
How to Fix It:
- Reinstall your theme or update it.
- Check the “Network” tab in DevTools (F12) to see if font files fail to load.
4. Plugin or Theme Conflict
A conflicting plugin or theme might override or disable icon fonts.
How to Fix It:
- Temporarily disable plugins one by one to identify the culprit.
- Switch to a default theme (like Twenty Twenty-Four) to see if icons reappear.
5. If your theme doesn’t have Font Awesome or icon settings options, try manually adding Font Awesome:
- Install a plugin like “Font Awesome” or “Better Font Awesome.”
6. CDN Users – Ask for CORS Support
If you’re using services like:
- Cloudflare
- BunnyCDN
- Amazon CloudFront
Reach out to their support team and ask how to allow CORS headers for font files. They’ll guide you through adding the right settings.
Seeing social icons display as square boxes can be frustrating, but with a few simple checks and tweaks, you can easily bring them back to life. Whether it’s caching, Font Awesome settings, or CORS headers, this guide should help you troubleshoot and fix the issue for good.
If this article helped you, feel free to share it — and if you have questions, drop a comment below!