🧹

HubSpot Rich Text Editor: How to Paste Clean HTML

Quick answer: HubSpot's rich text editor is a WYSIWYG field, and like any WYSIWYG field, it runs pasted content through its own formatting handler before it ever reaches the page. Clean your HTML before you paste it — either paste as plain text and reformat by hand, or clean the source markup first and paste it through the editor's Source Code view, which accepts raw HTML directly.

Why does pasted content behave differently in HubSpot?

HubSpot's default rich text module is a WYSIWYG editor, which means it's designed to show you formatted content while storing HTML behind the scenes. When you paste into it, it interprets what you're pasting and converts it into its own internal formatting — which is exactly the same category of problem as pasting Word content into any other WYSIWYG field, HubSpot's or not. If the source has inline styles, Word-specific classes, or Microsoft namespace tags, some of that comes through as visible formatting the editor didn't mean to preserve, and some of it just adds bulk to the underlying HTML without you seeing it.

What does the Source Code view actually fix?

Every rich text module has a source code option in its toolbar, usually shown as a "<>" icon. It opens a raw HTML view of that module's content, which lets you paste markup directly instead of going through the visual editor's paste handling.

That solves one problem and not the other. It stops the editor's own paste handler from reformatting or stripping your markup, since Source Code accepts what you give it more literally. It does not clean the content for you — if you paste Word-generated HTML into Source Code, you get Word-generated HTML in your page, inline styles and all, just without the editor having reformatted it on the way in.

Need Your Website Rebuilt the Right Way?. Bootstrap Creative designs and builds B2B and manufacturing websites that are fast, clean, and built to convert. See Web Design Services →

What's the actual workflow that avoids this?

Clean the content before it reaches HubSpot at all, then paste the result into Source Code. Run whatever you copied from Word or Google Docs through the Word to HTML Cleaner first — it strips the inline styles and Microsoft-specific markup while keeping your headings, links, and structure intact. What you paste into Source Code afterward is markup that's already clean, so there's nothing left for the editor to mangle or for you to hunt down later.

If you manage a HubSpot portal regularly rather than just cleaning up the occasional paste, a HubSpot consultant can set up modules and templates that make this a non-issue for whoever's publishing content day to day.

Is this the same as inlining CSS for email?

No, and it's worth keeping the two separate since they point in opposite directions. Cleaning pasted content is about removing formatting you don't want. Inlining CSS for a marketing email is about taking styles you do want and writing them directly onto each element as inline attributes, because many email clients ignore a <style> block in the head entirely and only respect inline styles. Both problems involve inline styles, but one is about stripping them and the other is about adding them back in a format email clients will actually honor.

Frequently asked questions

Where's the HTML source view in HubSpot's rich text editor?

Look for the source code icon (usually shown as "<>") in the rich text toolbar. It opens a raw HTML view of that module's content, separate from the visual editor.

Why does content still look wrong even after I paste into Source Code?

The Source Code view accepts whatever HTML you paste into it, including any inline styles or Word-specific markup already in it. It skips the rich text editor's own paste handling, but it doesn't clean the content for you — cleaning still needs to happen before you paste.

Is this the same problem as inlining CSS for marketing emails?

Related, but not the same. Cleaning pasted content removes formatting you don't want. Inlining CSS for email is closer to the opposite: taking styles you do want and writing them as inline attributes, because many email clients ignore a <style> block entirely.

HTML & CSS Cleaner Tool

As web developers and designers, we often encounter HTML files laden with inline styles—those pesky CSS rules embedded directly within HTML tags. While this approach might seem convenient at first, it can lead to bloated code, slower page load times, and maintenance headaches. Fear not! Our HTML and CSS Cleaner Tool comes to the rescue. Whether you’re a seasoned developer or just starting your web journey, understanding the importance of clean HTML and CSS is essential.

Built and maintained by Bootstrap Creative, a web design and marketing agency for B2B and manufacturing companies. · Blog