This article...
- Discusses Gmail's HTML code-size limit and how exceeding it can result in an email message being "clipped."
- Details the negative impact of clipped email messages, such as potential damage to sender reputation.
- Explains how excessive HTML code, frequent edits, and hidden content increase spam risks and clip likelihood.
- Describes best practices that can help reduce the amount of HTML code in a message.
NOTE: This article contains information that is not Higher Logic proprietary information. Higher Logic provides this information as a courtesy, but is not responsible for the contents.
Gmail imposes a "code size" limit on incoming email messages. If an incoming message exceeds this limit, the message could be "clipped." This "clipping" is at the discretion of the Gmail algorithm and could negatively impact the deliverability of — and engagement with — the messages that are sent from your account.
NOTE: If your messages are repeatedly clipped, eventually, your reputation as a "trusted sender" could be in jeopardy.
Higher Logic encourages you to review this information and to adopt the best practices in order to ensure the deliverability of your email messages.
Code-size limit details and affects
The code-size limit that Gmail imposes is 102kb.
- The limit pertains to the size of an email message's HTML code.
- The limit considers the HTML code of the body of the message only (i.e., the underlying markup, the text, any inline CSS, tracking pixels).
- It does not include images and attachments.
If an email message exceeds the code-size limit:
- Gmail truncates the message and displays View entire message at the bottom of the message, which the recipient has to click in order to view the entire message.
Your message deliverability
Consider the following impacts to your deliverability if your email messages exceed the code-size limit.
- Truncation could result in important elements in your message (your Unsubscribe link; a call-to-action) being hidden, which could lead to an increase in the number of spam complaints.
- Excessive and unnecessary HTML code (sometimes called "code bloat") often indicates poorly coded and suspicious messages which could increase the likelihood of spam filtering. Spammers often stuff hidden code; so, mail service providers handle these messages with caution.
NOTE: Excess code is often the result of repeated edits, external templates, and content that is pasted from other sources and which has hidden HTML (such as comments, excessive nested tags, unused styles), all of which can "inflate" the amount of HTML but without adding visual content.
- Some elements of a message (e.g., tracking pixels, personalization scripts, and dynamic content) can cause messages to exceed the code-size limit. If these are truncated, your analytics might suffer or your personalizations could fail.
Best practices to avoid the code-size limit
Below are a few recommendations on what you can do to avoid the code-size limit to better ensure that your messages get delivered.
- Remove extra spaces (e.g., ) and line breaks (e.g., <br>), and all unused/unnecessary code.
- Limit the number of nested tables and unnecessary inline styles (which are common in marketing messages). If possible, instead use external assets (images, stylesheets) rather than embedding them inline.
- Keep the message content as concise as possible.
- When possible, host content on the web and include a link to it in the message (e.g., instead of including all the text of a large article in the message).