While HTML comments are primarily for developers to organize code, their presence in email campaigns can indirectly influence deliverability. The consensus among email marketing experts is that comments, especially if excessive, malformed, or containing suspicious content, can increase email file size and potentially trigger spam filters. Although not always a direct cause for flagging, comments can be misinterpreted as hidden text, a common spammer tactic, or simply contribute to overall email 'bloat,' affecting loading times and recipient engagement. This can also pose a risk if comments are visible in certain email clients or contain sensitive information.
10 marketer opinions
While essential for developers, commented code in HTML emails generally offers no benefit to the end-user and can negatively impact deliverability. Email marketing experts advise that the presence of comments, especially if extensive or containing unusual content, can increase email file size and potentially trigger spam filters. These filters may misinterpret comments as attempts to hide text, a common spammer tactic. Although some filters might ignore valid, minimal comments, the consensus leans towards removing them entirely to ensure the cleanest possible code, avoid accidental display in certain email clients, and prevent any unintended negative effects on an email's spam score.
Marketer view
Marketer from Email Geeks explains that spammers use gibberish in non-visible comments to bypass content filters, suggesting that large amounts of comment code, especially gibberish, can make spam filters punish the email. She recommends testing and ultimately using a script to generate a clean version of the email by removing all comments, while allowing developers to retain original commented code.
26 Jan 2025 - Email Geeks
Marketer view
Marketer from Email Geeks explains that good Bayes spam filters typically remove HTML from valued tags, so comments might not count against an email, especially if they are three characters or less. However, he agrees it's bloat and recommends keeping quantity and size of comments to a minimum. He also notes that Microsoft's Hotmail often shows spam filled with junk text hidden in style tags, which implies similar issues.
10 Dec 2024 - Email Geeks
4 expert opinions
Email marketing experts generally agree that commented code in emails, while seemingly harmless, can negatively impact deliverability. Their presence adds unnecessary file size, contributing to 'bloat,' and can cause spam filters to scrutinize the email more closely. Filters may misinterpret comments as attempts to hide malicious content or to bypass keyword detection, a common spammer technique. Although their impact is often secondary to other factors, comments containing suspicious keywords, or those used excessively, increase the risk of an email being flagged. For highly regulated sectors like finance, the potential for liability means even hidden text in comments warrants removal.
Expert view
Expert from Email Geeks always recommends removing comment code from emails because it is unnecessary bloat and can trip up spam filters.
12 Oct 2023 - Email Geeks
Expert view
Expert from Email Geeks suggests that financial clients may have a higher threshold for liability, making it important to remove comments that could say anything impactful.
8 Jun 2024 - Email Geeks
4 technical articles
Major email service providers and deliverability experts advise removing commented code from emails before sending. While HTML comments do not directly trigger spam filters, they undeniably increase the email's file size. This 'bloat' can lead to emails loading slowly, potentially being truncated by internet service providers, or, when combined with other factors, may contribute to a slightly higher spam score. The overarching recommendation is to maintain clean, lean, and concise email code by stripping out all unnecessary elements, including comments, to ensure optimal deliverability and user experience.
Technical article
Documentation from Mailchimp explains that while HTML comments do not directly affect rendering, it is a general best practice to keep email code clean and concise by removing unnecessary white space, comments, and unused CSS, as they add to the file size.
22 Jun 2021 - Mailchimp
Technical article
Documentation from Twilio SendGrid advises minifying HTML by removing unnecessary characters, including comments. While comments do not directly harm deliverability, they increase email size, which can be a minor factor in deliverability as large messages might be truncated or delayed by some ISPs.
26 Feb 2025 - Twilio SendGrid
Can an email template trigger spam filters and cause deliverability issues?
Do email code analysis report errors impact deliverability?
Does a broken link in a commented out section of an email affect deliverability?
Does base64 encoding of plain text emails impact spam filter scores?
How does email code quality and size impact email deliverability?
What impact does malformed HTML have on email deliverability and spam filtering?