Back to Community

How to Change Fonts and Prevent Unwanted Font Loading in GDPR Cookie Compliance

20 threads Sep 16, 2025

Content

Many users of the 'GDPR Cookie Compliance' plugin encounter issues related to font loading. A common goal is to have the cookie banner seamlessly match a site's existing typography for both branding and performance reasons. This often involves preventing the plugin from loading its default font (Nunito) or the custom icon font (moovegdpr.ttf/.woff). Based on community discussions and solutions, here’s a breakdown of the problem and the most effective ways to resolve it.

Why Does This Happen?

The plugin loads specific fonts to ensure the cookie banner displays consistently across all websites. The primary fonts involved are:

  • Nunito: The default web font used for the banner text. It can be loaded from Google Fonts or locally from the plugin's directory.
  • moovegdpr.ttf/.woff: A custom icon font necessary for displaying interface elements like the close (X) button and tab icons within the banner's settings modal.

Even when users select the option to inherit their theme's font, the icon font may still load because it is required for core functionality. Performance-focused users or those with specific GDPR requirements regarding external resources often seek to minimize or eliminate these loads.

Common Solutions and Workarounds

1. Use the Built-in Plugin Setting (Recommended)

The simplest and most supported method is to use the feature added in later plugin versions.

  1. Navigate to the plugin's settings in your WordPress admin dashboard.
  2. Go to the Branding tab (sometimes labeled General Settings).
  3. Find the option labeled "Choose font" or "Inherit font-family from your WordPress theme".
  4. Select this option and save your changes.

Result: This action should prevent the Nunito font from being loaded. However, please note that the moovegdpr icon font will still load as it is required for the plugin's icons. The 'GDPR Cookie Compliance' team has confirmed this behavior is by design.

2. Check for Conflicting Plugins or Caching

If fonts are still loading after selecting the inherit option, another plugin or your server's cache might be the culprit.

  • Caching Plugins: Some caching or optimization plugins (e.g., Autoptimize) might have settings to preload fonts. Check these plugins' settings for any preload rules you may have added manually and clear all your caches after making changes.
  • Other Font Plugins: As seen in the sample threads, another plugin might be responsible for loading Google Fonts. Deactivate other plugins temporarily to identify the conflict.

3. Advanced: Custom CSS Enqueueing (For Developers)

For those who need to override styles without using !important declarations or who want to use a local copy of the main CSS file, a programmatic approach is available. This method involves copying the plugin's main CSS file to your theme and enqueuing it yourself, which prevents your changes from being overwritten on plugin updates.

  1. Copy the file from: /wp-content/plugins/gdpr-cookie-compliance/dist/styles/main.css
  2. Paste it into your theme's directory, maintaining a similar folder structure (e.g., /wp-content/themes/your-theme/gdpr-styles/main.css).
  3. Add the following code to your theme's functions.php file to deregister the plugin's style and enqueue your custom one instead:
function custom_gdpr_override_styles() {
    // Deregister the plugin's main CSS
    wp_deregister_style( 'gdpr-main' ); 
    
    // Enqueue your custom version from the theme
    wp_enqueue_style( 
        'custom-gdpr-main', 
        get_stylesheet_directory_uri() . '/gdpr-styles/main.css', 
        array(), 
        '1.0' // Use a version number to bust cache after updates
    );
}
add_action( 'wp_enqueue_scripts', 'custom_gdpr_override_styles', 999 );

Warning: This is an advanced technique. Always use a child theme and test thoroughly, as the plugin's internal handle for its CSS or the file structure may change in future updates.

4. Understanding the Icon Font

It is important to understand that completely removing the moovegdpr icon font is not recommended. The 'GDPR Cookie Compliance' team has stated that this font is essential for displaying functional icons, and removing it will break parts of the user interface. The font is relatively small, and its impact on performance is typically minimal.

Conclusion

For most users, the solution is straightforward: use the built-in "Inherit font-family from your WordPress theme" setting. For persistent issues, investigate caching configurations or other plugins. Developers seeking deeper customization can use the CSS enqueueing method. Remember that the icon font is a necessary component for the plugin's UI and cannot be removed without causing functional issues.

Related Support Threads Support