Skip to main content

Troubleshoot HTML Email Template Issues

While Divi Form Builder’s HTML email templates are self-managed by customers, we can suggest a few debugging steps to help resolve common formatting problems. One proven fix is to minify the HTML before pasting it into your form settings.

Why Minify HTML?

When WordPress processes HTML, it may insert extra whitespace or convert line breaks into escaped tags (e.g. </br>), breaking your layout.

note

Minifying HTML removes unnecessary whitespace and line breaks, ensuring that your email template stays intact when saved.

Step-by-Step: Minify Your HTML

  1. Copy your raw HTML.

    • In your favorite code editor, select all of the HTML you’ve built for your template.
  2. Use an HTML minifier tool.

    • Open an online minifier (e.g., HTML Minifier or similar).
    • Paste your HTML into the input field.
    • Enable options like “Remove comments,” “Collapse whitespace,” and “Minify inline CSS.”
    • Click Minify.
  3. Copy the minified output.

    • The tool will produce a single-line (or tightly-packed) version of your HTML.
    • Copy this cleaned-up code.
  4. Paste into Divi Form Builder.

    • In your form’s Email settings, locate the HTML Template field.
    • Replace the existing content with your minified HTML.
    • Save the form and send a test email to verify layout.

Common Symptom: </br> in Output

  • Cause: WordPress filters sometimes escape closing <br> tags when HTML contains new lines.
  • Impact: Instead of a line break, the email shows the literal string &lt;/br&gt;.
  • Resolution: Minification removes raw line breaks so WordPress cannot misinterpret them.

Need More Help? Try Divi Email Template Buddy

We’ve built a custom GPT to assist with HTML email templates—automatically troubleshooting and even generating starter code:

Use this sidekick to get instant feedback on your HTML, spot broken tags, and generate email-ready templates in seconds!

Divi Email Template Buddy GPT

Troubleshooting Checklist

  • HTML has been minified (no line breaks).
  • No unescaped <br> or other tags.
  • Test email renders correctly in at least two email clients.
  • Consider using the Divi Email Template Buddy for advanced checks.