---
title: ValidContentForArguments
description: Prevent the use of invalid arguments to the content_for tag.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-content-for-arguments
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-content-for-arguments.md
---

# ValidContentForArguments

Makes sure that the arguments passed to the [`content_for` tag](https://shopify.dev/docs/api/liquid/tags#content_for) are valid.

**Note:**

For LiquidDoc checks take a look at [`UnrecognizedContentForArguments`](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/unrecognized-content-for-arguments) and [`MissingContentForArguments`](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/missing-content-for-arguments).

***

## Examples

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

### ✗ Fail

In the following example, the `invalid` named argument is not accepted by the `content_for` tag.

```liquid
{% content_for "blocks", invalid: 10 %}
{% content_for "block", invalid: 10 %}
```

### ✓ Pass

In the following example, all named attributes are accepted by the `content_for` tag.

```liquid
{% content_for "blocks" %}
{% content_for "blocks", context.product: product %}
{% content_for "block", type: "slide", id: "my-static-slide" %}
{% content_for "block", type: "slide", id: "my-static-slide", context.product: product %}
```

***

## Options

The following example contains the default configuration for this check:

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

***
