# Liquid header tag

Source: https://support.storeconnect.com/articles/liquid-header-tag · Last modified 21 August 2026

The `header` Liquid tag sets HTTP response headers directly from your theme templates. When StoreConnect renders a page, it collects all headers set via this tag and includes them in the HTTP response sent to the browser.

## Syntax


```liquid

{% header name: "Header-Name", value: "header-value" %}
```


| Parameter | Required | Description |
|-----------|----------|-------------|
| `name` | Yes | The HTTP header name (e.g. `Content-Security-Policy`, `X-Custom-Header`) |
| `value` | Yes | The header value |

## Where you can use it

The `header` tag works in all of the following template contexts:

- Layout templates (`layouts/`)
- Page templates (`pages/`)
- Snippets (`snippets/`) — including those rendered via `{% render %}`
- Database content blocks (content stored in Salesforce)

Headers set in any of these contexts are merged together into the final HTTP response.

## Examples

### Set a Content-Security-Policy for one page


```liquid

{% if current_page.identifier == "home" %}
  {% header name: "Content-Security-Policy", value: "frame-ancestors 'self' example.com;" %}
{% endif %}
```


### Set a custom header from a layout


```liquid

{% header name: "X-Store-Region", value: current_store.name %}
```


### Set multiple headers


```liquid

{% header name: "X-Frame-Options", value: "SAMEORIGIN" %}
{% header name: "Referrer-Policy", value: "strict-origin-when-cross-origin" %}
```


When multiple `header` tags set the same header name, the last value wins.

## Notes

- Some core platform headers (such as `Content-Type` and `Set-Cookie`) are controlled by StoreConnect and cannot be overridden with this tag.
- Do not use this tag to expose sensitive information. Header values are visible to clients and intermediaries.
- Dynamic values from Liquid variables are supported in both `name` and `value` parameters.

---

## Follow StoreConnect

- [Email Newsletter](https://getstoreconnect.com/c/lp-newsletter)
- [LinkedIn Newsletter](https://www.linkedin.com/build-relation/newsletter-follow?entityUrn=7444956928444862464)
- [YouTube](https://www.youtube.com/channel/UCngKdP2x8l1wcbAKW3tvU8g)
- [LinkedIn](https://www.linkedin.com/company/storeconnect)
- [X / Twitter](https://x.com/storeconnecthq)

## Popular Links

- [Partners](https://getstoreconnect.com/partners)
- [News](https://getstoreconnect.com/articles/news)
- [Events](https://getstoreconnect.com/articles/events)
- [Feature Comparison](https://getstoreconnect.com/how-we-compare)
- [Download a free trial](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FMkeKUAT)
- [Book a Demo](https://getstoreconnect.com/contact)

## Documentation

- [Help documentation](https://support.storeconnect.com/help-documentation)
- [AI agents](https://support.storeconnect.com/ai)
- [Videos & tutorials](https://support.storeconnect.com/videos-tutorials)
- [Developer reference](https://support.storeconnect.com/developer-reference)
- [Release notes](https://support.storeconnect.com/release-notes)
- [Troubleshooting](https://support.storeconnect.com/troubleshooting)
- [Trust Center](https://trust.getstoreconnect.com/)
- [Status Page](https://status.storeconnect.com/)

## Contact

- info@getstoreconnect.com
- US +1 415 745 3230
- AUS +61 2 8365 2308

100 S Ashley Dr, Suite 600-2461
Tampa FL 33602-600 USA

Level 22, Sydney Place
180 George Street
Sydney, NSW, 2000, AUS

---

StoreConnect Support — https://support.storeconnect.com/articles/liquid-header-tag