Repository navigation
Your first import
Written against v0.35.0.
By the end of this page you will have imported one content type from a WordPress export file into a Statamic site, and seen the entries in the Control Panel.
It assumes the package is installed (see Installation (README)) in a Statamic application with at least one site configured, and that you have a WordPress WXR export: in WordPress, Tools, Export, then Download Export File.
Copy the .xml file into the application, for example storage/app/imports/example-site.xml. The command refuses a path it cannot read, so a permissions problem shows up before anything is imported.
php artisan statamic:import:wordpress storage/app/imports/example-site.xmlThe command scans the export and lists the content types it found with a count for each. Types it does not import are listed too, so you can see what will be left behind.
Answer the prompts for the Statamic site to import into and the content type to import, for example page. Where the type has a default destination (page goes to the pages collection), it is used; otherwise the command asks for one. The defaults are on Content types and destinations.
Before anything is written, the command warns about content that usually needs review by hand: Classic editor content, and Row, Details and Freeform blocks. You choose whether to continue.
Note: an unattended run cannot answer this prompt. --unsupported-content sets the answer ahead of time; see Command reference.
For each kind of data the type carries (entries, assets, tables, redirects), choose whether an item that already exists is overwritten, skipped, or imported as an additional item. The choices are on Content types and destinations.
The command imports the entries and their assets, enables any taxonomy or collection the content needs on the site, and builds the collection tree. It then asks whether to import another content type from the same file. Answer no when you are done: the command then finalizes the run (clears the Stache and caches, runs the deferred work such as navigation, sanitizes the entries and prints the warnings it collected).
Open the destination collection in the Control Panel. The imported entries are there, and a structured collection such as pages has its tree built from the WordPress parent pages. If they are not, see An import does not show in the Control Panel.
- Previewing an import with verify: run the same import against a copy first.
- Importing from the migration API: read the site directly instead of from an export file.
- Importing navigation menus and Importing MinervaKB articles: the two content types with their own flow.
Home | Your first import | Guides | Troubleshooting | Reference | README | Repository
Written against v0.35.0. Edit these pages in docs/wiki/ through a pull request; edits made in the wiki are overwritten by the next publish.
Getting started
Guides
- Importing from the migration API
- Previewing an import with verify
- Importing navigation menus
- Importing MinervaKB articles
Troubleshooting
Reference
Project