---
title: UniqueStaticBlockId
description: Identifies when two static blocks are using the same ID.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/unique-static-block-id
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/unique-static-block-id.md
---

# UniqueStaticBlockId

Makes sure that all static blocks have a distinct ID defined.

Two static blocks are considered duplicates when they share the same `id` and identical arbitrary parameters. Blocks with the same `id` but different arbitrary parameters (such as `variant`) are treated as distinct.

***

## Examples

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

### ✗ Fail

In the following example, there are two static blocks using the same ID:

```liquid
{% content_for "block", type: "text", id: "static-block" %}
{% content_for "block", type: "text", id: "static-block" %}
```

In the following example, the blocks share the same ID and identical arbitrary parameters:

```liquid
{% content_for "block", type: "text", id: "header-menu", variant: "mobile" %}
{% content_for "block", type: "text", id: "header-menu", variant: "mobile" %}
```

### ✓ Pass

In the following example, the two static blocks have distinct IDs:

```liquid
{% content_for "block", type: "text", id: "static-block-1" %}
{% content_for "block", type: "text", id: "static-block-2" %}
```

In the following example, the blocks share the same ID but have different arbitrary parameters, making them distinct:

```liquid
{% content_for "block", type: "text", id: "header-menu" %}
{% content_for "block", type: "text", id: "header-menu", variant: "mobile" %}
{% content_for "block", type: "text", id: "header-menu", variant: "navigation_bar" %}
```

***

## Options

The following example contains the default configuration for this check:

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

***
