Home/Help Center/Variables

Templates

Template Variables: Rules, Limits and Best Practices

How to number, place and map WhatsApp template variables correctly, the limits Meta enforces, and how variables resolve to real data when a message actually sends.

By Chirag Darji · Updated 27 Aug 2026 · 5 min read

On this page
  1. Before you start
  2. Steps
  3. What you will see
  4. Settings and options
  5. Troubleshooting
  6. Related reading
WhatsApp approved message template library in VGraple CRM

A WhatsApp template variable is a {{n}} placeholder that gets replaced with real data at send time, but Meta enforces strict rules on how they can be numbered, placed and spaced before it will even review the template. This article covers those rules, plus how a variable actually resolves to data once the template is approved and used.

Variables: first 5 of 6 steps

  1. 1Number variables sequentially from {{1}}
  2. 2Never open or close the message on
  3. 3Keep variables apart from each other
  4. 4Surround variables with enough fixed text
  5. 5Give each one a realistic sample
The steps on this page, in order.

Before you start

  • Variables are written directly into the body, or a single one into a text header, while building or editing a template; there is no separate variables screen at this stage.
  • Where a variable's value comes from at send time (a contact field, a fixed value, or a fallback) is set later, when the template is actually used in a broadcast, flow or automation, not while building the template itself.
  • Every variable needs a sample value before submission regardless of where it will later be mapped from; see media headers and sample values for that requirement in detail.

Steps

  1. Number variables sequentially from {{1}}. Type {{1}}, {{2}}, {{3}} and so on in the order they should appear, with no number skipped. {{1}} and {{3}} with no {{2}} anywhere in the template is rejected as a numbering gap.

Templates screen in VGraple CRM with the gallery, Meta library and sync options

  1. Never open or close the message on a variable. "{{1}}, your order has shipped" and "Your order has shipped, {{1}}" are both rejected. Add fixed text before the first variable and after the last one: "Hi {{1}}, your order has shipped."

  2. Keep variables apart from each other. "{{1}} {{2}}" with nothing but a space between them is rejected as adjacent variables, since the rendered value reads as one run-on string a reviewer cannot verify. Separate them with real words: "{{1}}, your {{2}} is ready."

  3. Surround variables with enough fixed text. A body that is mostly placeholders with barely any wording between them reads as a data form rather than a message, and the validator flags this as low variable density. Aim for full sentences around each variable, not a template that is essentially a mail-merge field list.

  4. Give each one a realistic sample. A sample like "Priya," "ORD-20891" or "2:30 PM" lets Meta's reviewer judge the sentence properly; a placeholder like "test" or "value1" does the opposite and is a common cause of rejection on its own.

  5. Map each variable at send time. When a template is used in a broadcast, a flow node, a drip sequence or an automation rule, each variable is mapped to where its real value comes from: a contact field (name, phone, email), a custom field, a fixed static value, or a tracked link. Every source except static text requires a fallback value, used whenever the underlying field is empty, so a send can never fail with a parameter-count mismatch because a contact's field happened to be blank.

What you will see

The live phone preview substitutes your entered sample values as you build the template, so you can read the message the way a reviewer, and later a customer, actually will. Once the template is in use, wherever it is sent from shows its own mapping interface for choosing each variable's data source and fallback.

Settings and options

RuleLimitWhere enforced
Body variablesUp to 10, numbered sequentially from {{1}}Pre-submission validator
Header variablesAt most 1, text headers onlyPre-submission validator
Footer variablesNone allowedPre-submission validator
Media header variablesNone allowedPre-submission validator
Variable at start or end of bodyNot allowedPre-submission validator
Adjacent variablesNot allowedPre-submission validator
Fixed text around variablesRoughly 20+ characters per variable recommendedPre-submission validator (warning)
Fallback value at send timeRequired for every non-static, non-tracked-link variable mappingBroadcast, flow, sequence and automation-rule variable mapping

Troubleshooting

SymptomLikely causeFix
"Variables can't be at the start of the template"The body opens directly on {{1}}Add a greeting or other fixed text before the first variable
"Variables can't be at the end of the template"The body closes directly on the last variableAdd a closing sentence or fixed text after it
"Two variables sit next to each other"Two {{n}} placeholders have nothing between themAdd a word or two of fixed text separating them
"Variable {{[n]}} is missing but {{[max]}} exists"Variables skip a number, for example {{1}} and {{3}} with no {{2}}Renumber so every integer up to the highest is used with none skipped
"Only [n] characters of fixed text around [m] variable(s)"The body is mostly placeholders relative to its fixed wordingRewrite as full sentences with the variables embedded naturally, rather than a list of fields
"Variable {{[n]}}: a fallback value is required" when mapping in a broadcastA non-static variable mapping has no fallback setEnter a fallback value used whenever the contact's field is empty

Variable rules are one part of the wider component structure a template follows; see headers, body, footer, buttons and carousel for the rest, and media headers and sample values for how header variables differ from body variables specifically.

Frequently asked questions

How many variables can one WhatsApp template have?
Up to 10 in the body, and at most 1 in a text header. A media header cannot hold a variable at all, and a footer cannot either, since a footer is identical for every recipient.
Why can't a variable go at the very start or end of a message?
Meta rejects both. A message that opens or closes directly on a variable gives the reviewer nothing fixed to judge the sentence against, so add a word or two of static text before the first and after the last variable.
Do variables need to be numbered in a specific order?
Yes, sequentially from {{1}} with no gaps: {{1}}, {{2}}, {{3}} and so on. {{1}} and {{3}} with no {{2}} is rejected as a numbering gap, even if {{2}} appears somewhere else, like the header.
What happens if a customer's contact field is empty when a broadcast sends?
The fallback value you set for that variable is used instead. A fallback is required for every non-static variable mapping specifically so a send can never fail with a parameter-count mismatch because a field happened to be empty.
Can two variables sit right next to each other, like {{1}}{{2}}?
No. Meta rejects two adjacent variables with nothing between them, since the rendered message reads as one run-on value and neither sample can be verified on its own. Put a word or two of fixed text between them.
Is there a minimum amount of fixed text required around variables?
Effectively yes. If the fixed text around your variables is much shorter than the variables themselves, roughly under 20 characters of fixed text per variable, the validator flags this as a message that reads like a data form rather than a sentence.

Run your WhatsApp on VGraple CRM

Free forever plan, official Meta WhatsApp Business API, set up in 15 minutes. No card needed.