The HTML Importer is a powerful feature that converts static HTML files into fully managed WordPress landing pages. This allows designers and marketers to use their favorite design tools and seamlessly import the results into ShahiLandin.
What the Importer Does
The HTML Importer:
- Extracts body content, inline styles, fonts, and other head assets
- Sanitizes HTML to remove unsafe elements and scripts
- Preserves CSS styling and layout fidelity
- Mirrors external assets (fonts, stylesheets) for reliable hosting
- Provides three rendering modes for theme integration
- Supports files up to 512KB in size
- Navigate to Landing Pages > HTML Importer in WordPress admin
- The 4-step wizard interface will load
- Appear in admin listings
- Be used as the default H1 heading (if not overridden)
- Generate the URL slug automatically
- File format:
.htmlor.htm - Maximum size: 512KB
- Must contain valid HTML markup
- Exported pages from page builders (Webflow, Unbounce, Leadpages)
- Hand-coded HTML files
- Saved HTML from design tools (Figma exports, Sketch)
- Quick imports from clipboard
- Small HTML snippets
- Testing markup before file upload
- Click the Analyze Input button
- The plugin processes your HTML and displays metrics
- Review the extraction summary
- Body nodes: Total number of HTML elements in the body
- Inline styles: Count of
tags in the document head
- Link tags: External stylesheets and font references
- Scripts detected: JavaScript files that may require special handling
tags (unless Advanced Assets is enabled)- Event handlers (onclick, onload, etc.)
- Unsafe HTML attributes
- Potentially malicious content
- "More than 50% of content was removed during sanitization": Your HTML contains many scripts or unsafe elements
- "Scripts detected but won't be imported": JavaScript requires administrator privileges to import
- "No body content found": HTML structure may be invalid
- Blank shell for pixel-perfect replicas
- No theme header or footer
- Full control over page layout
- Best for: Standalone campaigns, splash pages, complete designs
- Includes your WordPress theme's header and footer
- Prefixes imported CSS to prevent conflicts with theme styles
- Seamless integration with your site's navigation
- Best for: Landing pages that match your brand, content-heavy pages
- Experimental isolation using Shadow DOM technology
- Currently falls back to Scoped CSS
- Future-ready for advanced CSS isolation
- Best for: Testing cutting-edge features
- Head scripts are preserved during import
- External JavaScript files are mirrored to local storage
- Inline scripts are kept intact
- Importing pages with essential JavaScript functionality
- Analytics tracking codes in the HTML head
- Interactive elements that require scripts
- Render Mode: Confirms Canvas, Theme Scoped, or Shadow DOM
- Scripts: Shows whether scripts will be preserved
- "Head scripts were detected but not imported": Enable Advanced Assets if scripts are needed
- "CSS styles were removed during sanitization": Some CSS may contain unsafe content
- "Many images detected": Consider lazy loading for performance
- Create the landing page post
- Save HTML, CSS, and head assets
- Mirror external resources to your server
- Set the rendering mode
- Redirect you to the editor for final touches
- A success message appears with links to:
- The landing page is created with Draft status for safety
- External assets (fonts, stylesheets) are mirrored to
wp-content/uploads/shahilandin-assets/ - An asset manifest is saved for tracking imported resources
- Edit the HTML directly in meta boxes
- Add WordPress blocks above or below the imported content
- Adjust CSS styling in the dedicated CSS editor
- Change the rendering mode
- Configure analytics and A/B testing
- Publish when ready
- Minify your HTML and CSS before import
- Remove unnecessary whitespace and comments
- Split large pages into sections
- Contact your administrator to increase the limit
- Ensure file extension is
.htmlor.htm - Validate HTML syntax using an online validator
- Remove non-HTML content from the file
- Review your HTML for inline scripts and event handlers
- Use external JavaScript files instead of inline scripts
- Ask an administrator to enable Advanced Assets
- Clean up unsafe HTML before importing
- Ensure proper HTML structure with
tags - Validate HTML using W3C validator
- Wrap content in semantic HTML elements
- Enable "Preserve trusted
tags" in Step 3 (requires admin) - Ensure scripts are in the
section of your HTML - Check browser console for JavaScript errors
- Verify script URLs are accessible
- Clean markup: Remove development comments and unnecessary whitespace
- Inline critical CSS: Include essential styles in the HTML
- Optimize images: Compress images before adding to HTML
- Validate HTML: Use W3C validator to catch syntax errors
- Test locally: Preview the HTML file in a browser before import
- Use Canvas for standalone campaigns with custom branding
- Use Theme Scoped when you want consistent site navigation
- Test both modes to see which provides better visual results
- Fonts: The importer automatically mirrors Google Fonts and other web fonts
- Images: Use absolute URLs or base64-encoded images for reliability
- Stylesheets: External CSS files are downloaded and stored locally
- Scripts: Only imported if Advanced Assets is enabled
- Only import HTML from trusted sources
- Never enable script preservation for untrusted content
- Review sanitization warnings before publishing
- Test imported pages in a staging environment first
Accessing the HTML Importer
The Import Wizard
Step 1: Provide Source
This step collects basic information and your HTML source.
Landing Page Title (Required)
Enter a descriptive title for your landing page. This will:
Example: “Summer Sale 2025 Landing Page”
Custom URL Slug (Optional)
Customize the permalink for this landing page. Leave blank to auto-generate from the title.
Example: Enter summer-sale-2025 to create the URL yoursite.com/landing/summer-sale-2025
Upload HTML File
Click Choose File and select an HTML file from your computer.
Requirements:
Supported Sources:
Or Paste HTML
Alternatively, paste raw HTML markup directly into the textarea.
When to use:
Note: Pasted HTML overrides file uploads if both are provided.
Step 2: Preview Extraction
Before importing, analyze your HTML to see what will be extracted.
Running the Analyzer
Metrics Displayed
Sanitized Preview
A preview of the extracted body content appears after analysis. This shows what will actually be imported after security sanitization.
What gets removed:
Warnings
The analyzer may display warnings such as:
Step 3: Rendering & Assets
Choose how your landing page will render and handle advanced assets.
Rendering Modes
Shahi Canvas (Default)
Theme · Scoped CSS
Theme · Shadow DOM (Preview)
Advanced Assets
Preserve trusted tags from the head
Only administrators with the unfiltered_html capability can enable this option.
When enabled:
When to use:
Security Note: Only enable for HTML from trusted sources. Malicious scripts can compromise your site.
Step 4: Review & Import
Final review before creating your landing page.
Selections Summary
Review your chosen settings:
Warnings Summary
All warnings from Step 2 are displayed again for final review. Common warnings:
Import Landing Page Button
Click this button to:
After Import
Upon successful import:
- Edit Now: Open the landing page in the editor
- Preview: View the page as it will appear to visitors
Post-Import Editing
After import, you can:
Troubleshooting Import Issues
File Too Large
Error: "The uploaded file exceeds the maximum size of 512KB"
Solution:
Invalid HTML
Error: "Only HTML files are supported for import"
Solution:
Content Removed During Sanitization
Warning: "More than 50% of content was removed"
Solution:
No Body Content Found
Warning: "No body content found. Using the entire HTML as content"
Solution:
Scripts Not Working
Issue: JavaScript features don't work after import
Solution:
Best Practices
Preparing HTML for Import
Choosing the Right Render Mode
Managing External Resources
Security Considerations
---
For more advanced customization, see the Template Builder and Block Editor articles.
Share this article
Still need help?
Our support team is ready to assist you with personalized guidance for your workspace.