AI code is easy to paste into HubSpot. Maintaining it is a lot harder.

AI code is easy to paste into HubSpot. Maintaining it is a lot harder.
5:18

Pasting AI-generated code into HubSpot rich text can bypass the theme and module controls your team relies on to maintain your website.

drop-zone-icons-76-code-1

TL;DR: AI makes it easy to generate code and paste it into HubSpot rich text, but doing so can bypass the theme and module controls that keep the site consistent and maintainable.

 

The code may work immediately while introducing page-level markup, styling, or behaviour that’s harder to review, reuse, update, and support later.

 

Before adding generated code, check if the theme or an existing module already supports the requirement. If not, decide if the code belongs in the page content or should be implemented as part of your website's system.


drop-zone-icons-118-chat-bubbles

AI has lowered the barrier

Generating website code used to require enough development knowledge to write it, modify it, or at least understand what was being added.

A marketer can now describe what they want, generate HTML and CSS in seconds, paste it into the source view of a HubSpot rich text module, preview the result, and publish it.

What has changed is how easily custom code can be added to a website without anyone vetting how it affects the website.


HubSpot has a great CMS

drop-zone-icons-6-modules

HubSpot websites typically use a theme to manage a website, along with modules that give marketers controls for building and editing pages.

Themes and modules keep much of the implementation separate from day-to-day content editing. Marketers work with content, layout options, images, buttons, and other controls without needing to edit the underlying code.

Code pasted into rich text can bypass that model.

It can introduce its own markup, styling, responsive rules, or behaviours instead of using what the site already provides. It may duplicate something the theme or an existing module already handles. It can also make part of the page dependent on source code rather than the editing controls used elsewhere on the site.

The result can look completely normal while being maintained very differently from everything around it.


The risk isn’t limited to bad code

drop-zone-icons-169-trouble

AI-generated code can be good, bad, or somewhere in between. The same is true of code written by a person.

An AI tool doesn’t know how your theme works, which modules are available, what CSS already exists, how the site handles responsive design, or which accessibility decisions have already been made.

Unless that information is part of the request, the tool is only solving the immediate coding problem, which might simply be a visual design element like adding a new slider style.

A successful preview tells you the code rendered. It doesn’t tell you if it duplicates existing styles, conflicts with the theme, fits the site’s markup conventions, will remain easy to work with when the page changes, or even meet UX standards.

HubSpot’s Template Marketplace policies caution theme devs about adding custom classes and IDs through rich text source code because those styles can be overridden and create template issues.

The point isn’t that source code in rich text is inherently wrong. It’s that the code becomes part of a larger website system whether that context was considered or not.


The maintenance problem starts inside the page

drop-zone-icons-160-duplication

Code added through rich text lives with the page content.

If the same code is copied elsewhere, each copy can become its own version. If the site changes later, someone has to know those implementations exist, find them, understand what they do, and determine what needs to change.

The marketing team can also lose some of the editing advantages HubSpot provides. A change that would normally be handled through a module field or theme setting may instead require reopening the source code.

That may be manageable in isolation. It becomes harder to manage as custom code accumulates across the site.

The development work hasn’t disappeared. It has moved into the content layer, where it can be harder to see, review, and maintain.


drop-zone-icons-171-not-happy-guy

AI can make code easier to develop and publish

A marketer can now generate code they couldn’t have written independently. That creates a review problem.

If AI gives you a block of HTML and CSS, you can judge the visual result without necessarily knowing why particular markup was used, what a style rule affects, or if the same result could have been achieved using the site’s existing components.

The path from generating code to publishing it can now be much shorter than the path to understanding how it fits into the website.


Rich text source code still has a role

drop-zone-icons-104-good-code

Small, understood HTML adjustments, markup cleanup, and certain embeds like Youtube Videos can live in HubSpot’s source editor.

The issue is using generated code as the default answer when the website doesn’t immediately provide the result you want.

Before pasting it into the page, check what the theme and existing modules already support. If the requirement falls outside those capabilities, decide how it should be implemented and maintained.

Sometimes a small piece of code in rich text is appropriate. Sometimes an existing module needs to be adjusted. Sometimes the requirement belongs in a new module or another part of the site’s development system.

AI can help produce the code in any of those cases. It doesn’t determine where that code should live.


Easy to generate isn’t the same as easy to maintain

If the code is a small adjustment that belongs in the page content or an embed, rich text may be the right place for it. If it introduces layout, styling, behaviour, or functionality the website will need to reuse or maintain, treat it as part of the website system instead.

While AI can make the code faster to produce. It doesn’t change the responsibility that comes with publishing it.

Answer Engine Optimization