---
title: SchemaOncePerFile
description: Identifies files that contain more than one schema tag.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/schema-once-per-file
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/schema-once-per-file.md
api_name: liquid
---

# SchemaOncePerFile

Identifies files that contain more than one `{% schema %}` tag. Theme Check reports the second and later schema tags because `{% schema %}` can appear only once per file.

Each section or block file should define a single schema so Shopify can parse one settings definition for the file.

***

## Examples

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

### ✗ Fail

In the following example, `sections/product.liquid` contains two `{% schema %}` tags:

```liquid
{% schema %}
{
  "name": "Product"
}
{% endschema %}


{% schema %}
{
  "settings": []
}
{% endschema %}
```

### ✓ Pass

In the following example, `sections/product.liquid` contains one `{% schema %}` tag:

```liquid
{% schema %}
{
  "name": "Product",
  "settings": []
}
{% endschema %}
```

***

## Options

The following example contains the default configuration for this check:

```yaml
SchemaOncePerFile:
  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. If you can't avoid violating the rule, then you should disable the check using the [comment syntax](https://shopify.dev/docs/storefronts/themes/tools/theme-check/configuration#disable-checks-using-liquid-comments). This ensures that you intentionally disable the check for each instance.

```liquid
{% # theme-check-disable SchemaOncePerFile %}
{% schema %}
{
  "name": "Product"
}
{% endschema %}


{% schema %}
{
  "settings": []
}
{% endschema %}
{% # theme-check-enable SchemaOncePerFile %}
```

***
