Categories
WordPress

Import Unit test data on All sites of WordPress multisite with WP CLI

In case you need to test multiple themes with same plugin you are higly likely create a multisite for comparison or ease of testing

Install WordPress Importer plugin

wp plugin install wordpress-importer --activate-network

Get Latest xml file from Theme Unit Test page

Change to Upload directory

wget https://raw.githubusercontent.com/WPTRT/theme-unit-test/master/themeunittestdata.wordpress.xml

Now use this following command

wp site list --field=url | xargs -n1 -I % wp import ./themeunittestdata.wordpress.xml --authors=create --url=%

By milind

Milind is a Senior WordPress Engineer at rtCamp.
WordPress Ecosystem Contributor and AMP Support Engineer.