PHPackages                             juzed-dev/wp-cli-faker-fixtures - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. juzed-dev/wp-cli-faker-fixtures

ActiveWp-cli-package[Utility &amp; Helpers](/categories/utility)

juzed-dev/wp-cli-faker-fixtures
===============================

Easily generate fake data for WordPress with Faker and WP cli

v0.0.5(1y ago)210GPL-3.0-or-laterPHPPHP ^7.4 || ^8.0

Since Oct 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/JuZed-dev/wp-cli-faker-fixtures)[ Packagist](https://packagist.org/packages/juzed-dev/wp-cli-faker-fixtures)[ Docs](https://github.com/JuZed-dev/wp-cli-faker-fixtures)[ RSS](/packages/juzed-dev-wp-cli-faker-fixtures/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (6)Used By (0)

wp-cli-faker-fixtures
=====================

[](#wp-cli-faker-fixtures)

[![GitHub Workflow Status](https://camo.githubusercontent.com/60b1b74af05698f4a08fb7b856c77bbe0e298e31807263b81976b6b77e0dad51/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6a757a65642d6465762f77702d636c692d66616b65722d66697874757265732f54657374696e673f7374796c653d666c61742d737175617265)](https://github.com/juzed-dev/wp-cli-faker-fixtures/actions/workflows/testing.yml?query=branch%3Amaster+workflow%3ATesting)[![Packagist Downloads](https://camo.githubusercontent.com/4829b33dad457d00a9b61a25d291aa6cab82f55e321c37bbe8cb5d2536111087/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a757a65642d6465762f77702d636c692d66616b65722d66697874757265733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/4829b33dad457d00a9b61a25d291aa6cab82f55e321c37bbe8cb5d2536111087/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a757a65642d6465762f77702d636c692d66616b65722d66697874757265733f7374796c653d666c61742d737175617265)[![Packagist PHP Version Support](https://camo.githubusercontent.com/9eb9c3d75e9967c4b9961644cab656cdc2512d1cda178371cca8a87c7dba10bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a757a65642d6465762f77702d636c692d66616b65722d66697874757265733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/9eb9c3d75e9967c4b9961644cab656cdc2512d1cda178371cca8a87c7dba10bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a757a65642d6465762f77702d636c692d66616b65722d66697874757265733f7374796c653d666c61742d737175617265)

Forked from [wp-cli-fixtures](https://github.com/nlemoine/wp-cli-fixtures), inspired by [Faker](https://github.com/trendwerk/faker), this package provides an easy way to create massive and custom fake data for your WordPress installation.

It works with [Advanced Custom Fields (Pro)](https://www.advancedcustomfields.com/) and can generate random images with [Picsum](https://picsum.photos/) and rich text with [LorIpsum API](https://loripsum.net/).

This package is based on [nelmio/alice](https://github.com/nelmio/alice) and [fzaninotto/Faker](https://github.com/fzaninotto/Faker). Please refer to these packages docs for advanced usage.

**WARNING:** This package is mostly intended to be used for development purposes. Use it at your own risk, don't run it on a production database or make sure to back it up first.

Quick links: [Install](#install) | [Usage](#usage) | [Contribute](#contribute)

Install
-------

[](#install)

Using WP cli:

```
wp package install git@github.com:JuZed-dev/wp-cli-faker-fixtures.git
```

Using composer:

```
composer require --save-dev juzed-dev/wp-cli-faker-fixtures
```

Requires PHP `^7.4`.

Usage
-----

[](#usage)

### Create fixtures

[](#create-fixtures)

At the root of your project, create a `fixtures.yml` file (you can download it [here](https://raw.githubusercontent.com/JuZed-dev/wp-cli-faker-fixtures/master/examples/fixtures.yml)):

```
#
# USERS
#
JuZedDev\Fixtures\Entity\User:
  user{1..10}:
    user_login (unique):  # '(unique)' is required
    user_pass: 123456
    user_email:
    user_url:
    user_registered:
    first_name:
    last_name:
    description:
    role:
    meta:
      phone_number:
      address:
      zip:
      city:
    acf:
      facebook_url:
      twitter_url:

#
# ATTACHMENTS
#
JuZedDev\Fixtures\Entity\Attachment:
  default (template): # templates can be extended to keep things DRY
    post_title:
    post_date:
    post_content:
  images{1..15} (extends default): # Random Images
    file:  # We provide a picsum() provider which uses picsum for images.
  local_documents{1..2} (extends default): # Random Documents in a local folder
    file:
  local_images{1..10} (extends default): # Random Images in a local folder
    file:

#
# TERMS
#
JuZedDev\Fixtures\Entity\Term:
  category{1..10}:
    name (unique):  # '(unique)' is required
    description:
    parent: '50%? ' # 50% of created categories will have a top level parent category
    taxonomy: 'category' # could be skipped, default to 'category'
  tag{1..40}:
    __construct: ['post_tag'] # This is required to ensure the dynamic parent field above doesn't use tags as possible parents
    name (unique):  # '(unique)' is required
    description:
    taxonomy: post_tag
  places{1..4}: # custom taxonomy
    name (unique):  # '(unique)' is required
    description:
    taxonomy: place
    acf:
      address:
      zip:
      city:
      image: '@local_images*->ID'

#
# POSTS
#
JuZedDev\Fixtures\Entity\Post:
  # TEMPLATE
  default (template):
    post_title:
    post_date:
    post_content:
    post_excerpt:
    meta:
      _thumbnail_id: '@images*->ID'

  # POSTS
  post{1..30} (extends default):
    # 'meta' and 'meta_input' are basically the same, you can use one or both,
    # they will be merged, just don't provide the same keys in each definition
    meta:
      _thumbnail_id: '@images*->ID'
    meta_input:
      _extra_field:
    post_category: '3x @category*->term_id' # post_category only accepts IDs
    tax_input:
      post_tag: '5x @tag*->term_id'
      # post_tag: '5x  # Or tags can be dynamically created

  # PAGES
  page{contact, privacy}:
    post_title:
    post_type: page

  # CUSTOM POST TYPE
  product{1..15}:
    post_type: product
    acf:
      # number field
      price:
      # gallery field
      gallery: '3x @images*->ID'
      # oembed field
      video: https://www.youtube.com/watch?v=E90_aL870ao
      # link field
      link:
        url: https://www.youtube.com/watch?v=E90_aL870ao
        title:
        target: _blank
      # repeater field
      features:
        - label:
          value: term_id'
  categories{1..3}:
    menu_item_object: '@category*'
    menu_id: '@header->term_id'
  posts{1..3}:
    menu_item_object: '@post*'
    menu_id: '@header->term_id'
  page:
    menu_item_object: '@page*'
    menu_id: '@header->term_id'
```

The example above will generate:

- 10 users
- 15 attachments
- 2 PDFs (found locally)
- 10 images (found locally)
- 10 categories
- 40 tags
- 4 terms for custom taxonomy named 'place'
- 30 posts with a thumbnail, 3 categories and 5 tags
- 2 pages (Contact and Privacy)
- 15 custom post types named 'product'
- 50 comments associated with post and user
- 1 nav menu
- 8 nav menu items

**IMPORTANT:** Make sure referenced IDs are placed **BEFORE** they are used.

Example: `Term` or `Attachment` objects **must** be placed before `Post` if you're referencing them in your fixtures.

### Load fixtures

[](#load-fixtures)

To load `fixtures.yml`:

```
wp fixtures load

```

You can also specify a custom file by using the `--file` argument:

```
wp fixtures load --file=data.yml

```

### Delete fixtures

[](#delete-fixtures)

```
wp fixtures delete

```

You also can delete a single fixture type:

```
wp fixtures delete post

```

Valid types are `post`, `attachment`, `comment`, `term`, `user`.

### Add fake data to existing content

[](#add-fake-data-to-existing-content)

`wp-cli-fixtures` allows you to add/update content to existing entities by passing the ID as a constructor argument.

Add/update data to post ID 1:

```
JuZedDev\Fixtures\Entity\Post:
  my_post:
    __construct: [1] # Pass your post ID as the constructor argument
    post_title: ''
    post_content: ''
    post_excerpt: ''
```

Add/update data to 10 random existing posts:

```
JuZedDev\Fixtures\Entity\Post:
  post{1..10}:
    __construct: [] # Use a custom formatters to return a random post ID as the constructor argument
    post_title: ''
    post_content: ''
    post_excerpt: ''
```

### Entities

[](#entities)

#### Post

[](#post)

`JuZedDev\Fixtures\Entity\Post` can take any parameters available in [`wp_insert_post`](https://developer.wordpress.org/reference/functions/wp_insert_post/#parameters) + `meta` and `acf` key.

*Note: `post_date_gmt` and `post_modified_gmt` have been disabled, there are set from `post_date` and `post_modified`.*

#### Attachment

[](#attachment)

`JuZedDev\Fixtures\Entity\Attachment` can take any parameters available in [`wp_insert_attachment`](https://developer.wordpress.org/reference/functions/wp_insert_attachment/#parameters) + `meta`, `file` and `acf` custom keys.

*Note: `parent` must be passed with `post_parent` key.*

#### Term

[](#term)

`JuZedDev\Fixtures\Entity\Term` can take any parameters available in [`wp_insert_term`](https://developer.wordpress.org/reference/functions/wp_insert_term/#parameters) + `meta` and `acf` custom keys.

*Note: `term` and `taxonomy` must be respectively passed with `name` and `taxonomy` key.*

#### User

[](#user)

`JuZedDev\Fixtures\Entity\User` can take any parameters available in [`wp_insert_user`](https://developer.wordpress.org/reference/functions/wp_insert_user/#parameters) + `meta` and `acf` custom keys.

#### Comment

[](#comment)

`JuZedDev\Fixtures\Entity\Comment` can take any parameters available in [`wp_insert_comment`](https://developer.wordpress.org/reference/functions/wp_insert_comment/#parameters) + `meta` custom key.

`comment_date_gmt` has been disabled, it is set from `comment_date`.

#### Nav menu

[](#nav-menu)

`JuZedDev\Fixtures\Entity\NavMenu` is a term just like `JuZedDev\Fixtures\Entity\Term`. It takes an additional `locations` parameter to set the menu location.

```
JuZedDev\Fixtures\Entity\NavMenu:
  header:
    name: header
    locations:
      - header
```

#### Nav menu item

[](#nav-menu-item)

`JuZedDev\Fixtures\Entity\NavMenuItem` takes the same parameters as `$menu_item_data` in [`wp_update_nav_menu_item`](https://developer.wordpress.org/reference/functions/wp_update_nav_menu_item/#parameters)

*Note 1: replace dashes with underscore in keys (e.g. `menu-item-object` becomes `menu_item_object`).*

*Note 2: `menu-item-object` can also accept an entity object, if so, `menu-item-type` and `menu-item-object-id` will be filled automatically with appropriate values*

### ACF Support

[](#acf-support)

Each ACF supported entity (post, term, user) can have an `acf` key, which works just like `meta`.

```
JuZedDev\Fixtures\Entity\Post:
  post{1..30}:
    post_title:
    post_date:
    acf:
      # number field named 'number'
      number:
      # repeater field named 'features'
      features:
        - label:
          value:  You will need to run `composer run prepare-tests` before your first run.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

578d ago

PHP version history (2 changes)v0.0.1PHP ^8.0

v0.0.2PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4415fbe4a152b97e4cc5ac4cc3f11461a3ff1bbff3f85c34a5f6beb1b3beb00?d=identicon)[JuZed-dev](/maintainers/JuZed-dev)

### Embed Badge

![Health badge](/badges/juzed-dev-wp-cli-faker-fixtures/health.svg)

```
[![Health](https://phpackages.com/badges/juzed-dev-wp-cli-faker-fixtures/health.svg)](https://phpackages.com/packages/juzed-dev-wp-cli-faker-fixtures)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[hellonico/wp-cli-fixtures

Easily generate fake data for WordPress

10213.4k](/packages/hellonico-wp-cli-fixtures)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
