Add font families to your WordPress theme using theme.json

What is theme.json?

theme.json is a special file used in WordPress block themes to control the design of your site, like colors, spacing, fonts, and more — all without touching CSS or PHP.

What is Typography (Font Family)?

Typography refers to how text looks on your website. A font family is just the name of a group of fonts, like "Arial, sans-serif" or "Roboto".

Where do you add fonts in theme.json?

You add fonts in this section:

"settings": {
  "typography": {
    "fontFamilies": [ ... ]
  }
}

Each font entry looks like this:

{
  "fontFamily": "Arial, sans-serif",
  "slug": "arial-sans",
  "name": "Arial"
}
  • fontFamily: the actual font (like in CSS)
  • slug: a unique ID used in the background
  • name: what shows in the WordPress editor