---
title: EmptyBlockContent
description: >-
  A validation that identifies instances where the content_for blocks Liquid tag
  is used when the associated blocks array is empty or undefined.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/empty-block-content
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/empty-block-content.md
---

# EmptyBlockContent

Ensures that the Liquid tag `{% content_for 'blocks' %}` isn't used when the associated schema `blocks` array is empty or undefined.

***

## Examples

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

### ✗ Fail

In the following example, the Liquid tag `{% content_for 'blocks' %}` is used with an empty schema `blocks` array:

```liquid
<div>
{% content_for 'blocks' %}
</div>


{% schema %}
{
  "name": "Test",
  "blocks": []
}
{% endschema %}
```

In the following example, the Liquid tag `{% content_for 'blocks' %}` is used when the schema `blocks` array is undefined:

```liquid
<div>
{% content_for 'blocks' %}
</div>


{% schema %}
{
  "name": "Test"
}
{% endschema %}
```

### ✓ Pass

In the following example, the Liquid tag `{% content_for 'blocks' %}` is used with a non-empty schema `blocks` array:

```liquid
<div>
{% content_for 'blocks' %}
</div>


{% schema %}
{
  "name": "Test",
  "blocks": [
    {
      "type": "text"
    }
  ]
}
{% endschema %}
```

***

## Options

The following example contains the default configuration for this check:

```yaml
EmptyBlockContent:
  enabled: true
  severity: warning
```

| 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.

***
