Shopify Email "syntax error on line 80": causes and fixes
The Shopify Email "syntax error on line 80" means the custom HTML failed to parse at that line of your code. In a community thread, people fixed it by removing a link containing an ampersand, writing "and" instead of "&", and using the unsubscribe tag as text rather than inside an empty anchor.
Sohail Hussain9 min readShort answer
- Open your HTML in an editor with line numbers, read line 80 and the lines just above it, and look for a bare ampersand, an empty anchor around the unsubscribe tag, or a broken Liquid tag.
- The fixes people reported for this exact error: delete or rewrite the link that contains an ampersand, write "and" instead of an ampersand in text, and put the unsubscribe tag in as plain text instead of inside an empty anchor.
- If none of that helps, cut the template down to a skeleton that saves, then add sections back until the error returns.
You paste a custom HTML email, such as a loyalty announcement, into Shopify Email, click save, and get this:
syntax error on line 80
The editor refuses to save, and the message doesn't say what is wrong. It only tells you where the parser gave up.
Why the error happens
The number refers to a line in the code you pasted. Shopify's templating language is Liquid, so a malformed {{ }} output tag or {% %} logic tag can stop the save. The reported line is where the parser failed, and the real fault is often on that line or a few lines earlier.
The fixes below come from a Shopify community thread that was last active in September 2024. People on that thread reported three changes that cleared the error: removing a link that contained &, replacing & with and in text, and writing {{ unsubscribe_link }} as text instead of inside an empty anchor. I could not find Shopify documentation that explains the ampersand cases, and Liquid itself does not treat & as special. So I can't tell you why those edits worked. Treat them as things to try, not as documented rules.
| Likely cause | What you see on line 80 | First fix |
|---|---|---|
| Ampersand in a URL | A link with ?a=1&b=2 | Remove the link to test, then use & |
| Ampersand in visible text | "Rewards & Perks" | Write "and" or & |
| Unsubscribe tag inside your own anchor | <a href="{{ unsubscribe_link }}"> or an empty <a> | Use the tag as plain text |
| Broken Liquid tag | {{ with no }}, or {% with no %} | Close or delete the tag |
| Tag from another platform | An unknown tag or a differently styled merge tag | Remove it |
Step-by-step fixes
1. Find line 80 in your own file
- Paste your HTML into a code editor that shows line numbers, such as VS Code.
- Jump to line 80.
- Read that line and the three lines above it.
If the numbers don't seem to match, the editor may have added or stripped a wrapper when you pasted. Count from the first line of what you pasted, not from the first line of your original file.
2. Handle ampersands
A bare & usually appears in two places: a URL with several query parameters and visible text such as "Rewards & Perks".
Before:
<a href="https://example.com/rewards?tier=gold&ref=email">Rewards & Perks</a>
After:
<a href="https://example.com/rewards?tier=gold&ref=email">Rewards and Perks</a>
& is the correct way to write an ampersand in HTML, so the change is worth making whether or not it fixes this save. Work through it in this order:
- Change the visible text to "and" and try saving.
- If the error stays, replace each
&in URLs with&and save again. - If it still fails, remove the whole link, save, and see whether the error disappears. You can add the link back with a simpler URL, for example one with a single query parameter.
Shorter URLs help
If a link only needs one parameter, drop the others. A URL with no ampersand at all removes this whole class of problem.
3. Fix the unsubscribe tag
The usual mistake is wrapping the tag in your own anchor, or leaving an anchor with no text:
<a href="{{ unsubscribe_link }}"></a>
The reporter on the thread got a save by writing the tag as text where the link should appear, with no anchor of your own:
<p style="font-size:12px;">
To stop receiving these emails, {{ unsubscribe_link }}
</p>
Keep the spaces inside the braces exactly as shown. I can't confirm from the thread what the tag outputs, so after saving, send yourself a test and click the link. Don't assume it works because the editor accepted it.
4. Look for broken or foreign Liquid tags
If line 80 has no ampersand and no unsubscribe tag, check for curly braces that aren't part of a real Liquid tag:
- A
{{with no matching}}, or a{%with no%}. - A merge tag copied from another platform, such as
{{first_name}}, or an unsubscribe tag in another tool's format. - Minified CSS or script that happens to contain
{{or{%. - An
{% if %}or{% for %}block where someone deleted the matching{% endif %}or{% endfor %}.
Klaviyo's help center describes the same kind of Liquid errors when people paste its exports into Shopify templates. Deleting part of a conditional or loop produces errors such as a tag that was never closed. Each if needs a matching endif, and each for needs a matching endfor. That page is about Shopify notification templates, not Shopify Email, so use it as background on how Liquid fails, not as proof of what Shopify Email accepts. It is here: Klaviyo's troubleshooting page for template error messages.
5. Bisect a long template
If the template is long, find the fault by halving it:
- Save a copy of the full HTML.
- Delete the bottom half and try saving.
- If it saves, the fault is in the half you removed. Restore that half in two parts and repeat.
- If it still fails, the fault is in what remains. Remove half of that and repeat.
Because the error line can shift after you delete code, don't rely on the number alone once you start cutting.
Keep a backup
Always keep an untouched copy of your original HTML before deleting anything. Editing the only copy in a browser text box is how people lose a finished template.
Checklist before you try again
- Line 80 and the lines above it have no bare
&in text or URLs. - Every
{{has a}}and every{%has a%}. - The unsubscribe tag is plain text, not inside an empty anchor or an
href. - No merge tags from another platform remain.
- Every
ifandforblock has its closing tag. - You are saving from a clean paste, not from a copy that picked up extra characters.
If it still won't save
Strip the template to a skeleton: a heading, one paragraph and the unsubscribe line. If that saves, add sections back one at a time until the error returns. The last section you added holds the fault.
If even the skeleton fails, contact Shopify support through your store admin's help option. Send the exact error text, the line number, the time you tried, the browser you used, and the smallest HTML that reproduces the error. Here is a message you can copy:
Hello,
Shopify Email will not save my custom HTML. When I click save, I get:
"syntax error on line 80"
Details:
- Date and time of the attempt: {date and time, with timezone}
- Browser: {browser and version}
- What I tried: replaced & with & and "and", removed links with
query strings, wrote {{ unsubscribe_link }} as plain text
- Smallest HTML that still fails is pasted below.
Can you tell me what line 80 refers to and whether custom HTML in
Shopify Email has restrictions on tags or characters?
{paste minimal HTML here}
Thank you.
For background on clean email markup, see our notes on HTML email basics and the HTML email glossary entry.
Where Mailneo fits
Mailneo can't fix this error, because it comes from Shopify's editor. If you are weighing another tool, Mailneo has a visual block editor with an HTML code mode, and campaign and newsletter emails carry List-Unsubscribe headers. We have no native Shopify connector, and I haven't confirmed that a template built around Shopify's Liquid tags would work unchanged, so don't plan a migration around that. The newsletter area needs the Professional plan or higher.
Common questions
Does the line number match my pasted code?
It should refer to the code you pasted, but it marks where the parser stopped, not always where the mistake is. Check line 80 and a few lines above it before assuming line 80 itself is wrong.
Should I use & or the word "and"?
In visible text either works, and "and" is the simplest. In URLs, use & or shorten the URL, because rewriting the web address with the word "and" would break the link.
Can I leave out the unsubscribe link to get it to save?
I wouldn't. Marketing email generally needs a working unsubscribe mechanism, and the unsubscribe tag was part of what people on the thread had to adjust. Fix the tag instead of removing it, and test the link in a sent email.
Will these fixes still work in 2026?
I can't verify that. The thread is from 2024, and Shopify may have changed the editor or its messages since. If a fix from the thread doesn't change the result, move on to the bisecting steps above.
Explore: Email Compliance
Related Articles
ActiveCampaign "bad request" unsubscribe link: what to do
The error "bad request (unsubscribe link)" means the unsubscribe page rejected the URL it received. Often the link was cut, rewritten or altered before the click. Test a fresh send, compare the URL to the original, and give ActiveCampaign support the exact link and a timestamp if it still fails.
ActiveCampaign emails quarantined by Microsoft: unsubscribe link fix
If ActiveCampaign shows emails as sent but Microsoft 365 recipients never see them, the messages are probably quarantined after delivery. Confirm it in Microsoft 365 quarantine, move links onto a domain you own, authenticate with SPF, DKIM and DMARC, and ask recipients' admins to allow-list you.
ActiveCampaign Unsubscribe Link Bad Request Error: Test Fix
The "bad request" error on an ActiveCampaign unsubscribe link in a test email usually means nothing is wrong with your campaign. Test sends do not behave like live sends, so unsubscribe and personalization tags do not work. Send the campaign to yourself as a real recipient and click the link from that email.
beehiiv unsubscribe button "Oops something went wrong" in a test
If the unsubscribe link in a beehiiv test email lands on "Oops something went wrong", the likeliest cause is that the test has no real subscriber behind the link. Confirm it with a real send to an address you control, and contact beehiiv support if that fails too.
Ready to supercharge your email marketing?
Start sending smarter emails with AI-powered campaigns. No credit card required.
Get Started Free