---
title: ValidLocalBlocks
description: >-
  A validation that identifies instances where a local block is used incorrectly
  within a theme's structure.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-local-blocks
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-local-blocks.md
---

# ValidLocalBlocks

Ensures that local blocks are being used correctly. This check enforces rules to maintain consistency and prevent errors in theme structure.

***

## Validation on local blocks

This section covers validations for local blocks in sections and in theme blocks.

### ✗ Fail

In this example, local blocks are being defined within theme blocks:

## blocks/local-block.liquid

```liquid
{% schema %}
{
  "name": "Block name",
  "blocks": [
    {
      "type": "local_block",
      "name": "Local Block"
    }
  ]
}
{% endschema %}
```

In this example, theme blocks are being used along with local blocks:

## sections/local-block.liquid

```liquid
{% schema %}
{
  "name": "Section name",
  "blocks": [
    {
      "type": "text"
    },
    {
      "type": "local_block",
      "name": "Local Block"
    }
  ]
}
{% endschema %}
```

### ✓ Pass

In this example, local blocks are being used correctly within sections, and are not being used alongside theme blocks:

## sections/local-block.liquid

```liquid
{% schema %}
{
  "name": "Section name",
  "blocks": [
    {
      "type": "local_block",
      "name": "Local Block"
    }
  ]
}
{% endschema %}
```

***

## Options

The following example contains the default configuration for this check:

```yaml
ValidLocalBlocks:
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.

***
