How to Import WordPress into a Static HTML Site
The WP Importer allows you to import posts, pages, images, authors and tag or category data from your WordPress site into Publii. It also supports navigation menus and compatible SEO metadata. You can choose which content to bring across and review anything that needs attention in the import report.
For a broader look at the differences between the two platforms, read our WordPress vs Publii comparison.
There are two parts to the process: first, export your content from WordPress, then import it into a new or existing Publii website.
Exporting your WordPress content
WordPress exports content in WXR (WordPress eXtended RSS) format. This is an .xml file containing your site's content and related data. It isn't a complete website backup: your theme, plugins and the media files themselves aren't included.
To export your WordPress content, follow these steps:
- Log in to your WordPress site's dashboard and click on Tools → Export in the left sidebar.
- Select All content to include posts, pages, navigation menus and their related data. You can choose which post types to import later in Publii. If you only want specific posts, select Posts and filter them by category, author, date range or status.
- Click Download Export File and save the XML file to your computer.
The WXR file contains references to your images, not the image files themselves. Keep the original images accessible online until Publii has downloaded them and you've checked the results.
If WordPress provides your export as a ZIP archive, extract it first. Publii imports the XML files inside the archive; if there is more than one, import them separately.
Importing your WordPress content into Publii
You can start while creating a new Publii website or open the importer from an existing website. Both routes lead to the same import settings.
Starting with a new website
- Open Publii's website creation screen and select the Migrate from WordPress tab.
- Drag your WXR file into the upload area, or click Choose file and select the XML export.
- Publii checks the file and uses the available WordPress data to fill in the Website name and Author name. Review these values and change them if needed. You can also choose the website's icon and workspace accent. When available, the WordPress site description is saved as the new website's internal description.
- Click Create website and continue. Publii creates the website and opens the WP Importer with your file already selected and analysed.
At this point, the website has been created, but its content hasn't been imported. Review the settings below before clicking Import data.
Importing into an existing website
- Open the site you want to import your WordPress content into. Click on Tools in the left sidebar, then select WP Importer.
- Click Select WXR file, use the file selection field, or drag your XML export into the form.
- Publii verifies the file and displays a breakdown of its contents. This includes posts, pages, images, tags, categories and authors, along with any custom post types, navigation menus and menu items found in the file. Detected duplicate records and ignored WordPress system items are also shown.
The breakdown describes what's in the export. The settings below determine which content Publii will import and how it will be converted.
Choosing your import settings
The form is divided into three sections: Content to import, Content mapping, and Metadata and formatting.
Content to import
- Import selected post types: Choose whether to import posts, pages and any custom post types detected in the file. WordPress pages become Publii pages, with their parent-child hierarchy recreated. Selected custom post types become regular Publii posts; functionality provided by WordPress plugins isn't transferred.
- Import navigation menus: Import the navigation menus included in the export, preserving their order and nesting. Links are connected to imported Publii posts, pages and tags where possible. New menus aren't assigned to a theme position, so you'll need to choose their positions in Publii after the import.
Content mapping
- Post and page slugs: Choose Preserve slugs from WordPress (recommended) to retain the final part of each WordPress address, or Generate slugs from titles to create it from the content's title. Keeping the slug doesn't recreate WordPress permalink prefixes, such as dates or category paths. The full address follows your Publii website's URL settings.
- Which WordPress taxonomies should become Publii tags? WordPress has both tags and categories, while Publii uses tags to organise posts. Choose Tags, Categories, or Tags and categories (recommended). The selected terms become Publii tags and remain associated with their imported posts. Category parent-child relationships are flattened, and duplicate names are merged.
- Post authors: Choose Use main author from Publii to assign the imported content to your main author, or Import authors to bring in the WordPress authors and associate their content with them. For older WXR files without a complete author list, Publii also checks the author recorded against each post or page.
Metadata and formatting
- SEO metadata: Publii detects supported metadata from Yoast SEO, Rank Math, and All in One SEO, with partial WXR support for All in One SEO. When exactly one supported source is detected, Auto-detect the available SEO plugin (recommended) is selected. If several sources are found, choose one to import; their data won't be mixed. You can also select Do not import SEO metadata.
- Add paragraphs and line breaks: Enable this for content from the classic WordPress editor that needs blank lines converted into paragraphs and single line breaks converted into HTML line breaks. It skips Gutenberg content and preserves code and embedded content.
- Clean HTML: Enable this to remove unnecessary classes, decorative styles, editor attributes and empty paragraphs or containers from newly imported content. Image Cover blocks become standard images with their content below, without the background effects. Emphasis and functional markup are preserved. Complex content that cannot be safely cleaned may remain unchanged.
SEO import covers compatible titles, descriptions, robots settings, canonical URLs and primary categories. A primary category can become a post's main tag when that category is included in your taxonomy selection. Only supported values present in the WXR file can be imported; skipped or incompatible values are listed in the report.
The two content-formatting switches are off by default. They apply to newly imported content and don't reformat posts or pages recognised from a previous import.
Running the import
When you've chosen how to handle your content, click Import data at the bottom of the form. Publii displays progress as it imports the content and downloads associated images. The time required depends on the amount of content and the number and availability of the images.
Imported content is prepared for Publii's WYSIWYG editor. Valid publication and modification dates are preserved. Published WordPress content retains its published status, while drafts, private content and scheduled content become drafts in Publii. Items marked as trashed remain in the trash. Published sticky posts become featured posts.
Publii converts supported image markup, captions and galleries. WordPress gallery shortcodes become editable Publii galleries when the required image information is available. Supported standalone YouTube and Vimeo URLs, shortcodes and Gutenberg embeds are converted to Publii video embeds.
Internal links are updated to point to the corresponding imported content where possible. WordPress themes, plugins and their dynamic functionality aren't recreated, so some content may still need manual adjustment.
Reviewing the import report
The WordPress import report opens automatically when the import finishes. It includes a summary and separate sections for:
- The redirect map.
- Image download failures and unimported media.
- Unsupported shortcodes and dynamic blocks.
- Unresolved links.
- SEO metadata and other warnings.
- HTML cleanup results, if you enabled Clean HTML.
Start with the sections marked as requiring attention. For example, an image may have failed to download, or a shortcode may depend on a WordPress plugin. Check the affected content and download, replace or recreate the missing elements as needed.
Dynamic blocks may also need to be recreated in Publii. Any existing HTML is retained where available, but a block generated by WordPress or a plugin may have no saved HTML to import.
Use Copy this section to copy the selected section, or Copy full report to keep the complete report. You can reopen it using View last import report in the importer's header. Publii stores the latest report separately for each website, and it remains available after restarting the application. A later import replaces that website's previous report.
Preparing redirects
The Redirect map section lists the old WordPress paths and their corresponding Publii destinations, based on the domain and URL structure currently configured in Publii. Changed paths for published content receive active 301 rules. Unchanged paths and unpublished content are included as comments, and conflicting destinations are reported for review.
Use this map to prepare redirects on your hosting service. Importing content doesn't activate the redirects. Check that the destinations match your final website addresses, then adapt the rules to the format required by your hosting provider. If you use relative URLs and publish the website in a subdirectory, add the subdirectory prefix to the destination paths.
Checking images and the website preview
After you close the report, Publii may prompt you to generate thumbnails for your theme. If prompted, click Regenerate. You can also run the process later from Tools → Regenerate thumbnails.
Before publishing, assign positions to imported menus and preview your website. Check the imported posts and pages, images, galleries, videos and links, especially any content identified in the report. Download or replace media that wasn't imported before removing the original WordPress website.
Importing the same content again
Publii saves information linking imported posts and pages to their WordPress source. When it recognises those items during a repeated import, it reuses them instead of creating duplicates. It doesn't replace their saved content with the version in the WXR file or overwrite their SEO metadata. Re-importing therefore won't bring across later edits to the WordPress text or apply different formatting settings to existing Publii content.
A repeated import can still update internal links and image references as it resolves destinations or retries missing images. Author assignments can change when Import authors is selected. If menu import is enabled, previously imported menus are updated instead of duplicated, while any theme positions you assigned in Publii are retained.
Note: If you encounter an import issue, please let us know on our Community Forum. Include the relevant details from the import report to help explain the problem.