Hosting Cloudflare Foundation Icons Locally / Cutting connection to cloudflare

Hi everybody,

I am looking for some help to resolve the following challenge

Due to GDPR reasons, we want our site to not connect to a CDN like Cloudflare.
However, it appears, we (https://datatoolbox.de/) have used some nice looking icons in the BB that originate from “foundation icons” from Cloudflare.

a href=”https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css?ver=2.2.5.3

So I considered to cut the connection to the CDN.
First option would be to remove the icons, which does not appeal to me.
Second option would be to host the icons on the webspace.

Since I am not a CSS / Webdeveloper specialist myself, I really would appreciate some help.

Many thanks in advance.
Greets, Stefan

1 Like

You need to use wp_deregister_script() to deregister the cdn version and then re-register your local version.

add_action( 'wp_enqueue_scripts', function() {
  // deregister the cdn version.
  wp_deregister_style( 'foundation-icons' );
  //register local version in child theme
  wp_register_style( 'foundation-icons', get_stylesheet_directory_uri() . '/fonts/foundation-icons/foundation-icons.css' );
}, 11 );

Add to your child theme and add the icons css to the folder referenced in the child theme.

CDNS are perfectly GDPR friendly, you only have to mention it in your privacy page and link to the cdn privacy page.

Hi Pross,

Thanks, that worked out well.

I followed these instructions to deregister the style:

I prefer to have the users browsers to not connect any third party server, before he is able to read the privacy page. Otherwise, mentioning the CDNS on the privacy page would be useless in my opinion.

Cheers
Stefan