---
title: ValidSettingsKey
description: >-
  Identifies when preset settings key, default settings key, or referenced block
  setting key is defined in their respective schema.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-settings-key
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-settings-key.md
api_name: liquid
---

# Valid​Settings​Key

* Identifies keys inside `presets.[].settings` and `default.settings` that do not exist in `settings.[].id` within the same file's schema
* Identifies keys inside `presets.[](recursive .blocks.[]).settings` and `default.blocks.[].settings` that do not exist in `settings.[].id` within the referenced block's schema

***

## Examples

The following examples contain code snippets that either fail or pass this check.

### Preset settings

#### ✗ Fail

## sections/section.liquid

```liquid
{% schema %}
{
  "settings": {
    "type": "text",
    "id": "custom-setting",
    "label": "Custom Setting",
  },
  "presets": [{
    "name": "Preset",
    "settings": {
      "fake-setting": "not valid setting"
    }
  }]
}
{% endschema %}
```

#### ✓ Pass

## sections/section.liquid

```liquid
{% schema %}
{
  "settings": {
    "type": "text",
    "id": "custom-setting",
    "label": "Custom Setting",
  },
  "presets": [{
    "name": "Preset",
    "settings": {
      "custom-setting": "valid setting"
    }
  }]
}
{% endschema %}
```

### Default settings

#### ✗ Fail

## sections/section.liquid

```liquid
{% schema %}
{
  "settings": {
    "type": "text",
    "id": "custom-setting",
    "label": "Custom Setting",
  },
  "default": {
    "settings": {
      "fake-setting": "not valid setting"
    }
  }
}
{% endschema %}
```

#### ✓ Pass

## sections/section.liquid

```liquid
{% schema %}
{
  "settings": {
    "type": "text",
    "id": "custom-setting",
    "label": "Custom Setting",
  },
  "default": {
    "settings": {
      "custom-setting": "valid setting"
    }
  }
}
{% endschema %}
```

### Preset block settings

The sample block code below is used in the following pass/fail examples.

## blocks/example-block.liquid

```liquid
{% schema %}
{
  "settings": {
    "type": "text",
    "id": "block-setting",
    "label": "Block Setting",
  }
}
{% endschema %}
```

#### ✗ Fail

## sections/section.liquid

```liquid
{% schema %}
{
  "blocks": [{ "type": "example-block" }],
  "presets": [{
    "name": "Preset",
    "blocks": [{
      "type": "example-block",
      "settings": {
        "fake-setting": "not valid setting in example-block"
      }
    }]
  }]
}
{% endschema %}
```

#### ✓ Pass

## sections/section.liquid

```liquid
{% schema %}
{
  "blocks": [{ "type": "example-block" }],
  "presets": [{
    "name": "Preset",
    "blocks": [{
      "type": "example-block",
      "settings": {
        "block-setting": "valid setting in example-block"
      }
    }]
  }]
}
{% endschema %}
```

### Default block settings

The sample block code below is used in the following pass/fail examples.

## blocks/example-block.liquid

```liquid
{% schema %}
{
  "settings": {
    "type": "text",
    "id": "block-setting",
    "label": "Block Setting",
  }
}
{% endschema %}
```

#### ✗ Fail

## sections/section.liquid

```liquid
{% schema %}
{
  "blocks": [{ "type": "example-block" }],
  "default": {
    "name": "Preset",
    "blocks": [{
      "type": "example-block",
      "settings": {
        "fake-setting": "not valid setting in example-block"
      }
    }]
  }
}
{% endschema %}
```

#### ✓ Pass

## sections/section.liquid

```liquid
{% schema %}
{
  "blocks": [{ "type": "example-block" }],
  "default": {
    "name": "Preset",
    "blocks": [{
      "type": "example-block",
      "settings": {
        "block-setting": "valid setting in example-block"
      }
    }]
  }
}
{% endschema %}
```

***

## Options

```yaml
ValidSettingsKey:
enabled: true
severity: error
```

| Parameter | Description |
| - | - |
| `enabled` | Whether this check is enabled. |
| `severity` | The [severity](https://shopify.dev/docs/storefronts/themes/tools/theme-check/configuration#check-severity) of the check. |

***

## Disabling this check

Disabling this check isn't recommended.

***
