If you are using the Genesis Simple Social Icons to display links to your social media pages, you may have noticed that some of the icons have disappeared after a recent update.
Upon further inspection, you may notice that the icons haven’t disappeared, but instead are throwing an error “Unsafe attempt to load URL…” This error appears to be unique to users on the Chrome browser, although I haven’t tried all browsers on all OS so it could be more widespread.
In my case, this error occurred because the icons that the plugin uses were being served over a CDN. Since my host’s (WPEngine) CDN uses a unique URL for each site to serve content from. The “Unsafe attempt to load URL…” error comes up when the domains don’t match up.
So for example, if I’m using Simple Social Icons on this site (https://scottdeluzio.com), and the CDN is loading the icon file from the CDN’s domain (https://zonename-wpengine.netdna-ssl.com) the domains won’t match and we’ll end up with an error.
The solution to prevent this is to stop the icon file from being loaded off of the CDN’s domain. While this may lose the benefit of this one file loading over the CDN, it will enable the icons to load properly.
On WPEngine, the way to do this was not very obvious but the outstanding support agent I spoke with showed me exactly what to do.
- Visit your site where the icons are not showing up correctly, and press CTRL+Shift+I.
- Find the error that begins with “Unsafe attempt to load URL”
- Copy the first URL that should be pointing to the /wp-content/plugins/simple-social-icons/symbol-defs.svg file
- Login to your site’s wp-admin
- Click the WP Engine > General Settings menu
- Scroll to the bottom in the Advanced Configuration section and find the HTML Post-Processing box
- Enter the following expression in the box:
#https://zonename-wpengine\.netdna-ssl\.com/wp-content/plugins/simple-social-icons/# => https://yoursite.com/wp-content/plugins/simple-social-icons/
- Replace the zonename portion of the first URL with the equivalent portion of the CDN URL from your site – yours will be different.
- Replace yoursite.com with your actual domain name
If you have several sites on a multisite you can enter the expressions for each site in the same section (i.e. no need to login to each site’s admin), although you will need to copy the CDN URL from each site’s error and replace with the relevant site URL.
Tom says
Thanks for this, Scott. I was having this exact problem on a university multisite (on WPEngine).
Scott DeLuzio says
Glad it helped Tom!
Bob Dunn says
Thanks so much for finding this wonkiness on my site and reaching out to me… worked like a charm 🙂
Scott DeLuzio says
Glad to help Bob!
Evelyn Rios says
This solution worked for me, but with some alterations. I had to change the regex to:
#https://zonename\.wpengine\.netdna-cdn\.com/wp-content/plugins/simple-social-icons/# => https://yoursite.com/wp-content/plugins/simple-social-icons/
I also found that this created a super long load time for the page – not the most ideal solution.
Scott DeLuzio says
Hi Evelyn,
Out of curiosity, why was the regex change needed? The only thing I noticed different between yours and mine was netdna-cdn in yours v.s. netdna-ssl in mine. I’m guessing that’s because my site is running on SSL, but that’s just a guess?
I didn’t notice any difference in the load time for the site’s pages, so it’s strange to me that this would cause an issue on your site.
I suppose if my theory about SSL above is correct you could try to add the free Let’s Encrypt SSL on your site and update the regex to what I had and see if that helps improve the load time on your site.
Matt Ryan says
Excellent. Fixed. Thanks.
Scott DeLuzio says
Glad to help Matt.
Colin McAllister says
Great stuff – dealing with exact same issue on a WPEngine site right now. I’ve got the text trying to fix it and I sent them your article. Thanks for sharing and helping the community.