JayWood / jw-wpcli-random-posts

A robust random post generator for WP CLI which supports multisite, post types, post counts, taxonomies, terms, term counts and featured images. Complete with a cleanup command to undo it all!
http://plugish.com
57 stars 8 forks source link
lorem-ipsum multisite wordpress wp-cli

WP CLI Random Posts Generator

This WP CLI posts generator, unlike the core generator in WP CLI, supports the following:

NEW - using wp jw-random cleanup <options> this script now cleans up after itself.

Thanks to @fzaninotto for the Faker library.

What this does NOT do

Currently this CLI command does not support meta-data, mainly due to the amount of commands you would need to run for large sites. Still a great script if you need to generate some placeholder posts fast, especially with featured images and terms.

Installation

Installing the random post generator is SUPER easy, for the latest and greatest, do the following:

If you'd like a specific version, say 2.0, it's this simple:

Sample Commands

Generate 50 posts, no feature image

Possibly the simplest way to use the generator.

Create 10 posts with featured business images for an author

First find the author you want to attach the Post to

Now you know the author ID just use the --author flag like so:

The author field also supports slug ( login ), and email.

Create 10 posts with categories, tags, and featured images ( the usual stuff )

( --term-count tells the script to also add 15 terms to each taxonomy )

Clean up posts, terms, and media that was generated

( --force-delete permanently deletes posts and media instead of just trashing them )

Options

In the interest of keeping this readme slim, all options have been moved to the Wiki.

Changelog

2.0

1.4

1.3

1.2

1.1

1.0

Initial Release