---
title: UnrecognizedBlockArguments
description: Identifies block tag arguments that the target block doesn't accept.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/unrecognized-block-arguments
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/unrecognized-block-arguments.md
api_name: liquid
---

# UnrecognizedBlockArguments

Identifies arguments in a `{% block %}` tag that the target block doesn't accept. Theme Check reads `blocks/<name>.liquid` and accepts four kinds of argument: the ID of an input setting in the block's `{% schema %}`, a parameter declared in the block's [LiquidDoc](https://shopify.dev/docs/storefronts/themes/tools/liquid-doc), the built-in `content` parameter, and `block.name`. Every other argument is reported.

This check exits without reporting when the block file is missing or its schema is invalid. A block without a schema or LiquidDoc accepts only `content` and `block.name`. Block tags with a syntax error, such as a dotted argument name other than `block.name`, are skipped because [`LiquidSyntaxError`](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/liquid-syntax-error) reports them.

**Note:**

These checks all validate `{% block %}` tag arguments: [`DuplicateBlockArguments`](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/duplicate-block-arguments), [`MissingBlockArguments`](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/missing-block-arguments), [`UnrecognizedBlockArguments`](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/unrecognized-block-arguments), and [`ValidBlockArgumentTypes`](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-block-argument-types).

***

## Examples

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

The examples reference the following block, which declares `variant` in LiquidDoc and `label` as a schema setting:

## blocks/button.liquid

```liquid
{% doc %}
  @param {string} [variant] - Button variant
{% enddoc %}
<button class="button button--{{ variant }}" title="{{ label }}">{{ content }}</button>


{% schema %}
{
  "name": "Button",
  "settings": [
    { "type": "text", "id": "label", "label": "Label" }
  ]
}
{% endschema %}
```

### ✗ Fail

In the following example, the block doesn't declare `size`, so Theme Check reports `Unknown argument 'size' in block tag for 'button'.`:

## templates/index.liquid

```liquid
{% block 'button', variant: 'primary', size: 'large' %}
  Button content
{% endblock %}
```

### ✓ Pass

In the following example, `block.name` is always accepted, `variant` is declared in LiquidDoc, `label` is a schema setting, and the inline body is passed as `content`:

## templates/index.liquid

```liquid
{% block 'button', block.name: 'Add to cart button', variant: 'primary', label: 'Add to cart' %}
  Button content
{% endblock %}
```

***

## Options

The following example contains the default configuration for this check:

```yaml
UnrecognizedBlockArguments:
  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. 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 UnrecognizedBlockArguments %}
{% block 'button', variant: 'primary', size: 'large' %}
  Button content
{% endblock %}
{% # theme-check-enable UnrecognizedBlockArguments %}
```

***
