WP-CLI Post Generator
WP-CLI commands to generate posts with images and terms.
by Kees Meijer · github.com/keesiemeijer/wp-cli-post-generator · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/keesiemeijer/wp-cli-post-generator/archive/refs/heads/master.zipReadme
WP-CLI Post Generator
WP-CLI commands to generate dummy posts with images and terms.
This WordPress plugin is a convenient way to use all the WP-CLI commands from these plugins.
Use composer to load them as a dependency. See the installation instructions below.
Installation
clone this repository in the plugins folder
clone https://github.com/keesiemeijer/wp-cli-post-generator
Go to the plugin folder and install the dependencies.
cd wp-cli-post-generator
composer install
Activate the plugin
wp plugin activate wp-cli-post-generator
Usage
If this plugin is installed and activated you can use the commands provided by the plugins above. For more information about these commands see the documation of the plugins itself.
Basic Usage
Create 100 posts
wp post-gen create 100
Create 100 images
for ((i=1; i<=100; ++i)); do wp image-gen create "image-landscape"$i --text=image-$i --width=1024 --height=768 --textsize=120; done
Insert 100 images in post content
wp image-gen attach 10 --insert --align=random --size=random
Note: Posts must first be created to have images inserted or attached (see above).
Create 100 categories
wp term-gen create category --count=100 --max_depth=6
Assign category terms to 100 posts
wp term-gen assign category --max-terms=9 --posts=100 --post-type=post
Note: Terms from a taxonomy must first be created to assign them (see above).