Article

Google Fonts and WordPress Block Themes: A New Approach

Google Fonts in WordPress block themes have been stuck in an awkward middle ground. The old workaround—manually bundling font files into theme.json—works but misses the point. You download, register, maintain files, and lose the CDN speed that makes hosted fonts worthwhile in the first place.

The Create Block Theme plugin changes that. Maintained by the WordPress.org team, it offers a UI-driven way to integrate Google Fonts into block themes without touching template files or manually bundling anything.

At a glance

  • Classic PHP themes enqueue Google Fonts via functions.php
  • Block themes historically required manual font file bundling in theme.json
  • Twenty Twenty-Two and Twenty Twenty-Three show the evolution of the process
  • Create Block Theme plugin offers a no-code path for block themes
  • GDPR concerns around Google Fonts are pushing the industry toward self-hosting

Why block themes lagged behind

Classic themes had it easy. Drop a wp_enqueue_style call into functions.php, point it at fonts.googleapis.com, and the fonts load on every page. WordPress even has preconnect hints built in for performance.

Block themes threw that model out. The Twenty Twenty-Two default theme required registering each font file in functions.php AND defining them in theme.json. Two places to update for one change. Twenty Twenty-Three simplified things by skipping the registration step, but you still had to download the font files yourself and bundle them into the theme.

That defeats the point. Hosted Google Fonts are served from a fast CDN with caching, format negotiation, and zero maintenance. Bundling files locally gives you GDPR compliance but loses the CDN benefits—until now.

What the Create Block Theme plugin does

The plugin does what its name suggests: it creates block themes through the WordPress UI. No code required. Click through options, generate theme files, ship.

In a recent Theme Shaper article, Gutenberg project lead architect Matias Ventura outlined how the plugin lets you add Google Fonts (or any downloaded fonts) to block themes. The plugin connects directly to the font service, fetches the files you select, and bundles them into your theme automatically.

The plugin satisfies GDPR privacy requirements. Fonts are served from your own server rather than Google's, protecting visitor IP addresses. According to court decisions in some European jurisdictions, loading fonts from external servers without consent can violate data privacy rules.

The tradeoff: you lose the external CDN, but you gain compliance and full control over your font assets. For most projects, that's a fair trade.

How it works

Set up a local test site using Local by Flywheel or your preferred tool. Install the Theme Test Data plugin for dummy content, then add the Create Block Theme plugin.

Navigate to Appearance → Manage Theme Fonts in your WordPress admin panel. You'll see fonts already defined in your theme.json file with two choices:

  • Add Google Fonts** — fetches fonts straight from the service
  • Add Local Fonts** — imports font files you've already downloaded

The plugin then generates the necessary theme.json entries and embeds the font files into your theme directory. Updates happen through the same interface—no file management required.

Who should care

Scenario Recommended approach
Building themes for EU clients Bundle fonts via Create Block Theme
Personal projects without EU traffic External font delivery is still viable
Reselling themes to agencies Bundle everything—clients don't want GDPR liability
Need Inter, Roboto, or other popular fonts Built-in integration makes this painless now

What to watch next

The Create Block Theme plugin is the most promising direction, but it's not stable yet. Watch for it to graduate from experimental status. Also keep an eye on theme.json schema changes that may bake font handling more directly into WordPress core.

For GDPR, the legal landscape is still moving. If you ship WordPress themes to European customers, self-hosting is now the safer default—not just a nice-to-have.

Key takeaways

  • The Create Block Theme plugin is the best current path for adding fonts to block themes
  • GDPR rulings make self-hosted fonts the safer choice for European visitors
  • Bundling woff2 files is becoming the default for professionally-built themes

Frequently asked questions

What is the Create Block Theme plugin?

A WordPress.org-maintained plugin that lets you generate block themes, child themes, and style variations through the UI without writing code. It also handles font integration.

Why are hosted Google Fonts a GDPR risk?

Loading fonts from external servers exposes visitor IP addresses to third parties on every page view. Court rulings have found this can violate GDPR without explicit consent.

Can I still use external font delivery?

Technically yes, but with GDPR risk for European visitors. Self-hosting the same fonts in woff2 format is the safer choice.

Do classic themes still work with the old approach?

Yes. The wp_enqueue_style pattern in functions.php still works. The new tooling is specifically for block themes.

Related