How Conversion Works
MigrateKit automatically converts HTML from Webflow’s rich text fields into Sanity’s Portable Text format during migration. This process:- Parses HTML - Reads your Webflow HTML structure
- Maps tags to blocks - Converts HTML tags to Portable Text blocks and marks
- Preserves semantics - Maintains meaning, not just visual appearance
- Handles edge cases - Wraps unsupported content as code blocks
Supported HTML Tags
MigrateKit handles most common HTML tags from Webflow:Headings
| HTML | Portable Text | Usage |
|---|---|---|
<h1> | style: "h1" | Top-level headings |
<h2> | style: "h2" | Section headings |
<h3> | style: "h3" | Subsection headings |
<h4> | style: "h4" | Minor headings |
<h5> | style: "h5" | Rarely used |
<h6> | style: "h6" | Rarely used |
Paragraphs & Line Breaks
<p>→style: "normal"block<br>→ New line within block- Multiple
<br>→ New blocks
Text Formatting
| HTML | Portable Text Mark | Visual |
|---|---|---|
<strong> | marks: ["strong"] | Bold |
<b> | marks: ["strong"] | Bold |
<em> | marks: ["em"] | Italic |
<i> | marks: ["em"] | Italic |
<u> | marks: ["underline"] | Underlined |
<s>, <del> | marks: ["strike-through"] | |
<code> | marks: ["code"] | Inline code |
Lists
Unordered lists:Links
href- Preserved ashreftarget="_blank"- Preserved asblank: truerel- Preserved if present
Images (Inline)
Images within rich text are converted to image blocks:Handled with Warnings
Some HTML requires special handling:Tables
Limited SupportBasic tables (
<table>, <tr>, <td>) are converted to Portable Text, but complex tables with merged cells or nested tables may not convert perfectly.Recommendation: Review tables in Sanity Studio after import and adjust formatting if needed.Inline Styles
style attributes are stripped during conversion. Portable Text doesn’t preserve inline CSS.
Why? Portable Text separates content from presentation. You style content in your frontend, not in the CMS.
Custom Classes
Unsupported Content
Content that can’t safely convert becomes code blocks:Scripts & Embeds
Scripts appear as code blocks in Sanity—they won’t execute. This is a safety feature. Review and replace with Sanity-compatible alternatives.
Iframes
Custom Webflow Elements
Webflow’s custom elements (interactions, animations, CMS-bound elements) become code blocks:Conversion Examples
- Basic Formatting
- Lists
- Complex Nesting
HTML:Portable Text:
Best Practices
Before Migration
1
Clean up Webflow content
Remove unnecessary HTML before exporting:
- Delete empty
<div>and<span>tags - Remove inline styles you don’t need
- Simplify complex nested structures
2
Identify custom elements
Note any Webflow-specific elements that will need replacement:
- Custom interactions
- Dynamic embeds
- Complex grids or layouts
3
Test with small sample
Export a small collection first to see how your HTML converts
After Migration
1
Review code blocks
Check all code blocks in Sanity Studio:
- Replace scripts with Sanity-safe alternatives
- Convert iframes to proper embeds
- Remove unnecessary preserved HTML
2
Fix formatting issues
Adjust any conversion quirks:
- Incorrect heading levels
- Lost spacing
- Misinterpreted formatting
3
Add semantic improvements
Enhance content with Portable Text features:
- Custom block types
- Better link handling
- Responsive embeds
Common Issues
Line breaks disappeared
Line breaks disappeared
Cause: Multiple
<br> tags or <p> tags with empty content.Fix: Manually add paragraph breaks in Sanity Studio where needed.Formatting looks different
Formatting looks different
Cause: Inline styles or classes were stripped during conversion.Fix: Portable Text separates content from styling. Style your content in your frontend rendering, not in the CMS.
Images are missing
Images are missing
Cause: Images didn’t upload (network error, quota exceeded).Fix: Check the import report for asset failures and manually upload missing images.
Links are broken
Links are broken
Cause: Relative Webflow links may not work in new context.Fix: Update links in Sanity Studio to point to correct URLs.
Custom elements became code blocks
Custom elements became code blocks
Expected: MigrateKit preserves unknown HTML as code blocks for safety.Fix: Review code blocks and replace with Sanity-compatible alternatives.