Skip to content

Instantly share code, notes, and snippets.

@baikaresandip
Last active January 21, 2022 09:26
Show Gist options
  • Save baikaresandip/36cbd444028846de7d4f5d53a4ef5d7d to your computer and use it in GitHub Desktop.
Save baikaresandip/36cbd444028846de7d4f5d53a4ef5d7d to your computer and use it in GitHub Desktop.
Import WP Sample/Test data via WPCLI
# Import WP TESTS Data
# This needs the WordPress Importer plugin to be installed.
# Click on WordPress and install the WordPress Importer plugin, if it's not already installed, and click Activate Plugin & Run Importer after the installation completes.
# Change to your wordpress installation directory
cd $WPPATH
# Download the wp posts file by curl
curl -O https://raw.githubusercontent.com/manovotny/wptest/master/wptest.xml
# Import Media, Categories,Users, Posts via below commands
wp import wptest.xml --authors=create
#Remove the file
rm wptest.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment