WordPress glossary

theme.json

The file where a theme defines its settings and styles for blocks.

Most block themes include a theme.json file in their main folder, and classic themes can include one too. It was introduced in WordPress 5.8, and it’s where a theme tells WordPress which settings should be available when you edit your site, what everything should look like by default, and which optional styles you can choose between, like alternative styles for buttons.

The settings decide which options you get in the editor. A theme can define its own color palette, font sizes and spacing sizes, set the width of the content, and turn off options it doesn’t want you to use, like using custom colors that aren’t in the theme’s palette. The styles decide how the site and each type of block look by default, like the color of links, the font of headings or the spacing around buttons.

A simplified theme.json file with a color palette of two colors looks like this:

{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"settings": {
"color": {
"palette": [
{ "slug": "background", "color": "#ffffff", "name": "Background" },
{ "slug": "text", "color": "#000000", "name": "Text" }
]
}
}
}

By using these settings, block themes can be styled extensively without requiring CSS, and almost all of the styles defined in theme.json can be altered by site owners in the Site Editor. When you change the styles of your site in the Site Editor, your changes are saved to the database and applied on top of the theme’s theme.json file, so the file itself is never changed.

A theme can also include alternative sets of styles, called style variations, as separate JSON files in its styles folder.

Published November 23, 2026

Related terms