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

AI Summary

Generating summary...

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.xmlCode language: JavaScript (javascript)

Now use this following command

wp site list --field=url | xargs -n1 -I % wp import ./themeunittestdata.wordpress.xml --authors=create --url=%
Code language: JavaScript (javascript)

Leave a Reply