PHPackages                             trendwerk/faker - 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. trendwerk/faker

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

trendwerk/faker
===============

Fake data with WP-CLI.

0.1.3(7y ago)768012[2 issues](https://github.com/trendwerk/faker/issues)[2 PRs](https://github.com/trendwerk/faker/pulls)GPL-3.0+PHPPHP ^5.6 || ^7.0

Since Aug 12Pushed 5y ago3 watchersCompare

[ Source](https://github.com/trendwerk/faker)[ Packagist](https://packagist.org/packages/trendwerk/faker)[ Docs](https://github.com/trendwerk/faker)[ RSS](/packages/trendwerk-faker/feed)WikiDiscussions master Synced 3w ago

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

Faker
=====

[](#faker)

Fake post data with [wp-cli](https://github.com/wp-cli/wp-cli). Made for WordPress.

[![Build Status](https://camo.githubusercontent.com/0dd7ea8a7ff17c09699526e2a31a2ef59a262a2ed32a13b1e8f364fc36a876d5/68747470733a2f2f7472617669732d63692e6f72672f7472656e647765726b2f66616b65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/trendwerk/faker)

Relies on [nelmio/alice](https://github.com/nelmio/alice) and [fzaninotto/Faker](https://github.com/fzaninotto/Faker).

Extended with user capabilities by [5queezer/faker](https://github.com/5queezer/faker).

Install
-------

[](#install)

```
wp package install trendwerk/faker

```

Requires [wp-cli](https://github.com/wp-cli/wp-cli) &gt;= 2.0.

Usage
-----

[](#usage)

```
wp faker fake ...
```

#### Options

[](#options)

ParameterDefaultRequiredDescription```null`YesLocation to an [Alice](https://github.com/nelmio/alice) YAML file### Delete data

[](#delete-data)

```
wp faker delete
```

Deletes all fake data.

Support
-------

[](#support)

The YAML file supports:

FieldsDescription`WP_Post`All properties from [`wp_insert_post`](https://developer.wordpress.org/reference/functions/wp_insert_post/)`WP_User`All properties from [`wp_insert_user`](https://developer.wordpress.org/reference/functions/wp_insert_user/)`meta`Post meta`terms`Terms for taxonomies, see [Terms](https://github.com/trendwerk/faker#terms)`acf`[Advanced Custom Fields](https://www.advancedcustomfields.com/) fields, see [ACF](https://github.com/trendwerk/faker#acf)YAML / Faker
------------

[](#yaml--faker)

Your YAML file(s) could look like any the examples below.

For more understanding of the internals:

- The YAML file is interpreted by [nelmio/alice](https://github.com/nelmio/alice);
- Any of the functions from [fzaninotto/Faker](https://github.com/fzaninotto/Faker) are available;
- Additionaly, the [``](https://github.com/trendwerk/faker#terms) function is provided by this library.

### Basic

[](#basic)

```
Trendwerk\Faker\Entity\Post:
  post{1..100}:
    post_content:
    post_title: ''
```

Generates 100 posts with a title and content.

### Post Type

[](#post-type)

```
Trendwerk\Faker\Entity\Post:
  post{1..100}:
    post_title: ''
    post_type: 'testimonials'
```

Generates 100 posts from the post type `testimonials` with a title.

### Meta

[](#meta)

```
Trendwerk\Faker\Entity\Post:
  post{1..100}:
    post_title: ''
    post_type: 'testimonials'
    meta:
      name: ''
      address: ''
```

Generates 100 testimonials with a title and a custom field called `name` and one called `address`.

### Terms

[](#terms)

```
Trendwerk\Faker\Entity\Post:
  post{1..100}:
    post_content:
    post_title: ''
    terms:
      category:
      post_tag:
```

Generates 100 posts with a title, content, 1 random category and 7 random tags.

*Using `` is not required. You could also provide an array of integers yourself or use [randomElements](https://github.com/fzaninotto/Faker#fakerproviderbase).*

#### Options

[](#options-1)

ParameterDefaultRequired`taxonomy``null`Yes`amount``1`No### ACF

[](#acf)

```
Trendwerk\Faker\Entity\Post:
  post{1..100}:
    post_content:
    post_title: ''
    acf:
      name: ''
      address: ''
```

Generates 100 posts with a title, content, and two filled ACF fields: `name` and `address`.

#### Duplicate field names

[](#duplicate-field-names)

In ACF, it is possible to have multiple fields with the same name. This could cause formatting conflicts when faking data with this library. If you have two fields with the same name, **using the unique field key is recommended**:

```
Trendwerk\Faker\Entity\Post:
  post{1..100}:
    post_content:
    post_title: ''
    acf:
      field_56cf2f782e9b1: '' # Name
      address: ''
```

### Users

[](#users)

```
Trendwerk\Faker\Entity\User:
  user{1..10}:
    user_login: ''
    user_pass: ''
    first_name: ''
    last_name: ''
    display_name: ' '
    user_email: ''
    role: 'author'
```

Generates 10 users with the role of an author.

### Attachments

[](#attachments)

Currently the only type of supported attachments are images.

#### Images

[](#images)

```
Trendwerk\Faker\Entity\Image:
  image{1..3}:
    data: ''
```

Generates 3 image attachments. Images are provided by [Faker](https://github.com/fzaninotto/Faker#fakerproviderimage), which in turn are provided by [LoremPixel](http://lorempixel.com/).

#### Post + (Featured) Image + User

[](#post--featured-image--user)

```
# image.yml
Trendwerk\Faker\Entity\Image:
  image{1..3}:
    data: ''
```

```
# user.yml
Trendwerk\Faker\Entity\User:
  user{1..10}:
    user_login: ''
    user_pass: ''
    user_email: ''
    role: 'author'
```

```
# post.yml
Trendwerk\Faker\Post:
  post{1..1}:
    post_content:
    post_title: ''
    post_author: '@user*->id'
    meta:
      _thumbnail_id: '@image*->id'
```

You can now supply all three files to `wp faker fake`:

```
wp faker fake image.yml user.yml post.yml
```

**Make sure you load the file that contains the referenced objects first.**

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.8% of commits — single point of failure

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 ~303 days

Total

4

Last Release

2693d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ce3274dfde64e7afdd8a1c06a861dd0e65267afaba097fda8bad934877a471f?d=identicon)[haroldangenent](/maintainers/haroldangenent)

---

Top Contributors

[![haroldangenent](https://avatars.githubusercontent.com/u/1481468?v=4)](https://github.com/haroldangenent "haroldangenent (83 commits)")[![5queezer](https://avatars.githubusercontent.com/u/34570565?v=4)](https://github.com/5queezer "5queezer (14 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (6 commits)")[![danielbachhuber](https://avatars.githubusercontent.com/u/36432?v=4)](https://github.com/danielbachhuber "danielbachhuber (1 commits)")

###  Code Quality

TestsBehat

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/trendwerk-faker/health.svg)

```
[![Health](https://phpackages.com/badges/trendwerk-faker/health.svg)](https://phpackages.com/packages/trendwerk-faker)
```

###  Alternatives

[wp-cli/scaffold-command

Generates code for post types, taxonomies, blocks, plugins, child themes, etc.

1728.2M20](/packages/wp-cli-scaffold-command)[wp-cli/core-command

Downloads, installs, updates, and manages a WordPress installation.

5210.9M26](/packages/wp-cli-core-command)[wp-cli/entity-command

Manage WordPress comments, menus, options, posts, sites, terms, and users.

1059.5M77](/packages/wp-cli-entity-command)[wp-cli/search-replace-command

Searches/replaces strings in the database.

598.0M8](/packages/wp-cli-search-replace-command)[bheller/images-generator

Generator of placeholder images for Faker

573.1M3](/packages/bheller-images-generator)[wp-cli/checksum-command

Verifies file integrity by comparing to published checksums.

338.1M12](/packages/wp-cli-checksum-command)

PHPackages © 2026

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