title: Disable/Remove Google Fonts from WordPress
body: <p>Remove / Disable Google Font WordPress</p>
  <p>I'm using the getwid block in WordPress to extend the Gutenberg editor. this brings with it google fonts, which then establish a connection to google. this can lead to privacy issues and that's why i want to include the local fonts and disconnect from the online google api.</p>
  <p><a href="https://i.stack.imgur.com/I9Dn9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I9Dn9.png" alt="enter image description here" /></a></p>
  <p>I've tried different ways to disconnect from Google and mount locally. Unfortunately I haven't made it yet. 1. - 4. are inserted via the functions.php. 5. are inserted above the footer.php I read that Getwid has built-in filters to disable Google Fonts. So I tried again some javascript code to disconnect.</p>
  <hr />
  <p><strong>1. attempt</strong> Filter to separate the google fonts elementor</p>
  <pre><code>add_filter('elementor/frontend/print_google_fonts', '__return_false');
  </code></pre>
  <p>I tried that with getwid</p>
  <pre><code>add_filter('getwid/frontend/print_google_fonts', '__return_false' );
  </code></pre>
  <p><strong>2. attempt</strong> Disconnect Google Fonts via mime types</p>
  <pre><code>add_filter('upload_mimes', 'add_custom_upload_mimes');
  function add_custom_upload_mimes($existing_mimes) {
  $existing_mimes['otf'] = 'application/x-font-otf';
  $existing_mimes['woff'] = 'application/x-font-woff';
  $existing_mimes['woff2'] = 'application/x-font-woff';
  $existing_mimes['ttf'] = 'application/x-font-ttf';
  $existing_mimes['svg'] = 'image/svg+xml';
  $existing_mimes['eot'] = 'application/vnd.ms-fontobject';
  return $existing_mimes;
  }
  </code></pre>
  <p><strong>3. attempt</strong>
  Completely removes all calls to the API</p>
  <pre><code>add_filter('blocksy:typography:google:use-remote', function () {
    return false;
  });
  
  add_filter('blocksy_typography_font_sources', function ($sources) {
    unset($sources['google']);
    return $sources;
  });
  </code></pre>
  <p><strong>4. attempt</strong> Remove individual fonts</p>
  <pre><code>function remove_google_fonts_stylesheet() {  
      wp_dequeue_style( 'google-fonts-opensans' );
  }
  add_action( 'wp_enqueue_scripts', 'remove_google_fonts_stylesheet', 999 );
  </code></pre>
  <p><strong>5. attempt</strong> Disable Google Web Fonts with JavaScript</p>
  <pre><code>document.addEventListener('om.Scripts.init', function(event) {
  event.detail.Scripts.enabled.fonts = false;
  </code></pre>