docs menu

Migrate from WordPress

The WordPress source reads the WXR file that WordPress writes in Tools, Export, with all content selected. It does not call the WordPress REST API.

Import#

bash
galerne import --from wordpress --file ./example.WordPress.2026-10-17.xml --dry-run
galerne import --from wordpress --file ./example.WordPress.2026-10-17.xml

Options go after --from as flags in kebab case (projectId is --project-id). With the import_from tool, they go in options. See the migration overview for the shared flags, the report and re-runs.

OptionWhat it is
fileThe WXR file
urlThe same file at a public URL (tools)
dataThe same XML inline (tools)
siteUrlThe site address, to recognise internal links and images. Default: the one in the file

How content maps#

WordPressGalerne
Posts, pages, custom post typesDocument types post, page and so on; ids <post type>-<WordPress id>
Title, slug, excerpt, datetitle, slug (when every slug is valid and unique, else a string), excerpt, publishedAt
Content (blocks or classic HTML)body rich text
Featured imagefeaturedImage
AttachmentsMedia with alt text, title and caption; ids wp-<id>
Categories and tagsDocuments, referenced from categories and tags; categories keep their parent
Authorsperson documents, referenced from author
Sticky, parent, menu ordersticky, parent, menuOrder
Custom fields without a leading _A meta object of text fields, with a warning
Links to the site, images from the media librarydoc:<id> links, media:<id> images
Status publishPublished

What the import loses#

The report lists each of these when it happens.

  • Drafts, pending, private and scheduled posts come in as drafts, with a warning. Trash, auto-drafts and revisions are skipped, and so are menus and other system types.
  • Comments are dropped, with their count in the report.
  • Scripts, iframes, SVG and forms inside content are dropped. Images hosted elsewhere stay as they are, with a warning.
  • Translation plugins (Polylang, WPML) are not read: each translation comes in as its own post.

Export to WordPress#

bash
galerne export --to wordpress --out ./wp-export --site-url https://example.com
OptionWhat it is
siteUrlSite address written in the file, default https://example.com
titleSite title
mediaBaseUrlBase URL of attachments. Default: relative attachments/ paths

The folder holds export.xml (WXR 1.2) for Tools, Import, the files under attachments/, and a README.md. Categories, tags and people become terms and authors.

The export loses:

  • One version per document: the published version, with a warning when a newer draft exists.
  • Only the fields WordPress has are written: title, slug, body, excerpt, date, author, featured image, categories, tags, sticky, parent, menu order and text custom fields. Other fields are left out.
  • Languages are not written. The guidelines document is left out.
  • Embeds in the body become <div data-galerne-embed> elements that hold the block as JSON. Your theme renders them; importing the file back turns them into embeds again.