Blockstudio
General

Settings

Blockstudio includes a powerful settings API, that allows setting options via a blockstudio.json file inside your theme folder and/or filters. Additionally, allowed users are able to change the settings visually inside the admin area.

Via JSON

If a blockstudio.json file is present inside your theme folder, it will be used to set the default options for the current site. A JSON schema is available to validate the file and help with autocompletion when used in an IDE.

The following properties are available:

blockstudio.json
{
  "$schema": "https://blockstudio.dev/schema/blockstudio",
  "users": {
    "ids": [],
    "roles": []
  },
  "assets": {
    "enqueue": true,
    "minify": {
      "css": false,
      "js": false
    },
    "process": {
      "scss": false
    }
  },
  "editor": {
    "formatOnSave": false,
    "assets": [],
    "markup": false
  },
  "ui": {
    "enabled": false
  },
  "library": false,
  "blockEditor": {
    "disableLoading": false,
    "enhance": false,
    "cssClasses": [],
    "cssVariables": [],
    "blocks": {
      "allow": [],
      "deny": [],
      "directory": true,
      "categories": {
        "allow": [],
        "deny": [],
        "rename": {},
        "order": []
      },
      "styles": {
        "deny": {}
      },
      "legacyWidgets": {
        "hide": []
      }
    },
    "patterns": {
      "core": true,
      "remote": true,
      "theme": true,
      "blockstudio": true,
      "categories": {
        "allow": [],
        "deny": [],
        "rename": {},
        "order": []
      }
    },
    "media": {
      "openverse": true,
      "imageSizes": {
        "allow": [],
        "deny": []
      }
    }
  }
}

Via Filters

Alternatively you can use the blockstudio/settings/${setting} filter to set options via PHP for more flexibility.

functions.php
add_filter('blockstudio/settings/assets/enqueue', '__return_false');
add_filter('blockstudio/settings/editor/formatOnSave', '__return_true');
add_filter('blockstudio/settings/ui/enabled', '__return_true');
add_filter('blockstudio/settings/block_editor/patterns/remote', '__return_false');

Options set via the blockstudio/settings/${setting} filter will override the ones set via the blockstudio.json file. Both methods can be used together.

Available Settings

users

OptionTypeDefaultDescription
idsarray[]User IDs with editor access
rolesarray[]User roles with editor access

assets

OptionTypeDefaultDescription
enqueuebooleantrueAuto-enqueue block assets
minify.cssbooleanfalseMinify CSS output
minify.jsbooleanfalseMinify JS output
process.scssbooleanfalseProcess SCSS files

editor

OptionTypeDefaultDescription
formatOnSavebooleanfalseFormat block.json on save
assetsarray[]Additional assets to load in editor
markupbooleanfalseEnable markup editing

library

TypeDefaultDescription
booleanfalseEnable the block library

tailwind

OptionTypeDefaultDescription
enabledbooleanfalseEnable Tailwind CSS compilation
configstring""Tailwind v4 CSS-first configuration

ui

OptionTypeDefaultDescription
enabledbooleanfalseRegister the bundled bsui/* UI components and app/* demo apps

blockEditor

OptionTypeDefaultDescription
disableLoadingbooleanfalseDisable block loading in editor
enhancebooleanfalseEnable Blockstudio editor hover and selection affordances
cssClassesarray[]Stylesheet URLs to extract CSS classes from for the classes field autocomplete
cssVariablesarray[]Stylesheet URLs to extract CSS variables from for the code field autocomplete

blockEditor.blocks

Use blockEditor.blocks for project-wide block inserter policy. allow and deny accept block names and wildcard patterns such as core/*.

blockstudio.json
{
  "blockEditor": {
    "blocks": {
      "allow": ["core/*", "my-theme/*"],
      "deny": ["core/embed", "core/freeform"],
      "directory": false,
      "categories": {
        "rename": {
          "text": "Writing",
          "design": "Layout"
        },
        "order": ["my-theme", "text", "media"]
      },
      "legacyWidgets": {
        "hide": ["archives", "calendar"]
      }
    }
  }
}

blocks.styles.deny unregisters styles that were registered through WordPress' PHP block style registry:

blockstudio.json
{
  "blockEditor": {
    "blocks": {
      "styles": {
        "deny": {
          "my-theme/card": ["outline"],
          "my-theme/media": ["framed"]
        }
      }
    }
  }
}

blockEditor.patterns

Use blockEditor.patterns to disable global pattern sources and to filter pattern categories.

blockstudio.json
{
  "blockEditor": {
    "patterns": {
      "core": false,
      "remote": false,
      "theme": true,
      "blockstudio": true,
      "categories": {
        "deny": ["gallery"],
        "rename": {
          "featured": "Featured Layouts"
        },
        "order": ["featured", "buttons"]
      }
    }
  }
}

blockEditor.media

Use blockEditor.media for global media inserter policy.

blockstudio.json
{
  "blockEditor": {
    "media": {
      "openverse": false,
      "imageSizes": {
        "allow": ["thumbnail", "large"],
        "deny": ["medium_large"]
      }
    }
  }
}
Guide: UI ComponentsEnable and compose the bundled headless UI components introduced in Blockstudio 7.3.

On this page