How-To

Buttondown "Script tags are not allowed": causes and fixes

Buttondown's "Script tags are not allowed" error means its validator found a script tag in your email, and reports say it rejects one even inside a code block. Remove the tag or show the snippet another way. Until the body passes, the email can't go out and stays in Draft.

Sohail HussainSohail Hussain9 min read

Short answer

  • Buttondown blocks any script tag in the email body, and people report it also fires when the tag sits inside a Markdown code block. Search the draft for the word script, delete the embed or snippet, and save again.
  • If you need to show the tag to readers, link to the code or use a screenshot. If the error persists with no script text left, contact Buttondown support with the draft ID and the exact error.

You write or paste something into Buttondown and get Script tags are not allowed. Maybe it appeared when you saved, previewed or tried to schedule, and now the email sits in Draft. Maybe you only wanted to show a code sample in a fenced block, so the error feels wrong.

I can't see Buttondown's validator, and I couldn't find a Buttondown help page that documents this message. What I have is a Capterra review describing emails stuck in Draft in August 2025, and reports of the same complaint on Buttondown's public discussion board. An answer was reportedly posted there, but I couldn't confirm its wording. So the fixes below are ordered by likelihood and cost, and I mark where I'm inferring.

Why Buttondown rejects script tags

Buttondown is Markdown-first, and Markdown lets you write raw HTML. RFC 7763, which registers the Markdown media type, notes that HTML can contain instructions to execute scripts. The same RFC says a better approach is to analyze (and sanitize or block) the output markup, rather than attempting to analyze the Markdown. A platform that publishes your text as email, web archive pages and an RSS feed has good reason to block script tags. MDN describes the <script> element as used to embed executable code or data, typically JavaScript. That is the kind of content an email host does not want to pass through.

Email clients generally don't run JavaScript in messages anyway, so a script tag in a newsletter does nothing useful for the reader. Blocking it costs legitimate senders little, except in one case: writing about code.

Why a code block can still trigger it

In standard Markdown rendering, a tag inside a fence is shown as text. If Buttondown rejects it anyway, the likely explanation is that the check runs on the raw source text before rendering. That is my inference from the reports, not documented behavior. It would also explain why people feel the error is unfair: the check does not know the tag is inside a fence.

Why the email sits in Draft

The most plausible link is that an email that fails validation can't move from Draft to scheduled or sent. I haven't seen Buttondown confirm this. If your draft is in Draft for another reason (you never scheduled it, or a required field is missing), removing the script text won't change the status by itself.

Causes at a glance

CauseWhat you seeFix
Pasted embed (video, poll, form, widget)Error right after pasteDelete it; use a link or image
Tutorial snippet with a script elementError even in a fenced blockShow only the inner code, or link to it
Hidden markup copied from a web pageError with no visible scriptSearch the raw source; paste as plain text
Duplicated older draftError on a draft that looks cleanSearch the old body; rebuild it
Validator also matches escaped textError after you escaped bracketsUse a link or image instead

Step-by-step fixes

Fix 1: find the tag you can't see

  1. Open the draft in the raw Markdown or source view if Buttondown offers one for your editor mode.
  2. Search the whole body for script, case-insensitive. Also search for <iframe and <embed, since pasted embeds often come as a group.
  3. Delete every match that is not a snippet you intend to show.
  4. Save again. If the error goes away, the cause was a pasted embed or hidden markup.

Text copied from a web page often carries hidden markup. When you paste, use your editor's paste-as-plain-text option (usually Ctrl+Shift+V or Cmd+Shift+V) so only the visible text arrives.

Check duplicated drafts

If you built this email by duplicating an older one, search the old body too. The tag may have come along from a previous issue and no longer be visible in the preview.

Fix 2: show the code without the wrapper

If you are teaching and the reader needs the code, not the tag, drop the script element and show what goes inside it:

function greet(name) {
  return "Hello, " + name;
}

Add a sentence saying it goes inside a script element on the page. A reader loses nothing, and the draft has no script text to match.

Fix 3: escape the angle brackets (test first)

If the tag itself must be visible, try writing it with HTML entities in ordinary text, outside a fence:

&lt;script src="https://example.com/app.js"&gt;&lt;/script&gt;

Outside a code block, a Markdown renderer turns the entities into visible angle brackets. I can't promise this passes: if Buttondown decodes entities before scanning, it will still be rejected. Inside a fenced block the entities would show literally as &lt;, so don't combine the two. Try it on a throwaway draft, not on the issue due in an hour.

I would skip tricks that disguise the tag, such as inserting invisible characters. They make the source harder for you to maintain and can break copy-paste for readers.

This is the dependable route when the first three fail. Pick one:

  1. Host the snippet somewhere you control (a gist, your docs, your site) and link to it. Readers can copy it, and you can fix it later without resending.
  2. Screenshot the formatted snippet and add alt text that describes it. Readers can't copy from an image, so I'd use this only for short snippets.

For anything longer than a few lines, I'd pick the link.

Fix 5: check that Draft is really the problem

After the body is clean, confirm what is holding the email back:

  1. Save and open the preview. If the error appears again, something script-like is still in the body.
  2. Check that the subject is filled in and that you actually scheduled or sent the email. Saving alone leaves it as a draft.
  3. Send a test to yourself before the real send.

Checklist before you try again

  • No script text remains in the raw source of the draft.
  • No pasted embeds (video, form, poll, analytics widget) remain.
  • Any code sample is either shown without the tag or linked.
  • You pasted from the web as plain text.
  • The draft was saved and previewed with no error.
  • A test email arrived before you schedule the real one.

If nothing works

Write to Buttondown support through the contact route in your account, or ask on their public discussion board. If you can, include the draft's URL or ID, the exact error text, when it appears (save, preview, schedule or send), the snippet you think triggers it pasted as text, a timestamp with your timezone, and what you've tried. Support can see the validator; I can't.

Subject: "Script tags are not allowed" on a draft with no script text

Hi, my draft will not leave Draft status.

Draft ID / URL: {draft-url}
Error text: Script tags are not allowed
When it appears: {on save / preview / schedule / send}, at {time, timezone}
What I tried: removed pasted embeds, searched the source for "script",
escaped angle brackets, replaced the snippet with a link.
The only code in the draft is: {paste the snippet as text}

Can you tell me which part of the body triggers the check, and whether
code inside a fenced block is expected to be rejected?

Why ask about fences

Asking directly whether fenced code is meant to be rejected gets you a documented answer instead of a guess, and it helps the next person who hits this.

Keeping it from happening again

For technical newsletters, link to code instead of pasting it, and don't paste embeds from other tools. Send yourself a test well before the deadline so a rejected draft doesn't surprise you at publish time. For background on what email clients actually render, see Email plain text vs HTML and the HTML email glossary entry.

If your newsletter needs interactive content, a script tag won't deliver it in email. AMP for email is the sanctioned route, though it has its own sender requirements and client support is limited.

Common questions

Does the error mean my email is unsafe?

No. It means a check matched script text in the body. The text can be harmless, such as a tutorial example, and still trigger it.

Can I put JavaScript in a newsletter at all?

Not in a way that runs. Major email clients don't execute JavaScript in messages, so a script tag has no effect for readers. If you want to show code to teach, display it as text or link to it.

Is this documented by Buttondown?

I couldn't find a Buttondown help page for this exact message. The evidence is user reports and a reportedly answered discussion thread, so treat the "code block triggers it" behavior as reported, not confirmed.

Will escaping the brackets work?

It might, if the validator checks rendered output instead of raw text. It's cheap to test on a draft, and if it fails, fall back to a link or screenshot.

strategybuttondownerror-codes
Share this article
Sohail Hussain

Sohail Hussain

Founder & CEO at Mailneo

Building Mailneo — AI-powered email marketing for growing businesses.

Ready to supercharge your email marketing?

Start sending smarter emails with AI-powered campaigns. No credit card required.

Get Started Free