---
title: BlockContentUsage
description: Identifies block.content lookups in theme block files.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/block-content-usage
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/block-content-usage.md
api_name: liquid
---

# BlockContentUsage

Identifies `block.content` lookups in theme block files. A theme block receives the body content of a [`{% block %}`](https://shopify.dev/docs/api/liquid/tags/block) tag as the built-in `content` parameter, so read it with `{{ content }}` instead of `{{ block.content }}`.

Theme Check reports `block.content` and `block['content']`, including longer lookups such as `block.content.size`, wherever they appear in Liquid code: in output tags, in tag markup such as `{% if %}` conditions and `{% render %}` arguments, and in `{% liquid %}` tags. Theme Check ignores lookups inside `{% raw %}`, `{% javascript %}`, `{% stylesheet %}`, and `{% schema %}` tags, and other `block` properties, such as `block.id` and `block.settings.content`.

This check applies only to files in the `blocks` directory.

***

## Examples

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

### ✗ Fail

In the following example, the block reads its body content through `block.content`, so Theme Check reports `Use the implicit 'content' parameter directly instead of 'block.content'.`:

## blocks/card.liquid

```liquid
{% if block.content != blank %}
  <div class="card">{{ block.content }}</div>
{% endif %}
```

### ✓ Pass

In the following example, the block reads its body content through `content`, and reads other values through `block.id` and `block.settings.content`:

## blocks/card.liquid

```liquid
{% if content != blank %}
  <div class="card" id="card-{{ block.id }}">
    {{ content }}
    {{ block.settings.content }}
  </div>
{% endif %}
```

***

## Options

The following example contains the default configuration for this check:

```yaml
BlockContentUsage:
  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. 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 BlockContentUsage %}
{{ block.content }}
{% # theme-check-enable BlockContentUsage %}
```

***
