April 10, 2017 · WordPress

Migrate content to new Wordpress site

Download wp-cli and place it in your new root wordpress directory


curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Go to your origin wordpress export page, usually url look like this: /wp-admin/export.php

download the xml file with all contents, place it into your new wordpress root directory

Noted that the --user flag is optional, it is a flag for bulk posts management.


php wp-cli-phar import <your_wordpress_contents.xml>  --authors=skip --user=<author_id_of_imported_contents>