concept-image / wp-data-seeder
Seed real WordPress content from a YAML tree: pages and their children, custom post types, taxonomy terms, ACF values, menus and Polylang translations, updated in place on re-runs (`wp acorn data:seed`).
Package info
gitlab.com/concept-image-public/wp-data-seeder
pkg:composer/concept-image/wp-data-seeder
Requires
- php: >=8.4
- roots/acorn: ^6.4
- symfony/yaml: ^7.4|^8.0
Requires (Dev)
- brain/monkey: ^2.6
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^4.0|^5.0
- pestphp/pest-plugin-arch: ^4.0|^5.0
- php-stubs/acf-pro-stubs: ^6.0
- szepeviktor/phpstan-wordpress: ^2.0
- wpsyntex/polylang-stubs: ^3.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Real WordPress content from one YAML file
For Concept Image Acorn themes (Bedrock + Sage): paste the site tree, run one command, get the pages and their children, custom post type entries, terms, ACF values, ACF options pages, menus and Polylang translations. Everything is validated before anything is written, and re-runs update in place: nothing is duplicated or deleted.
Dummy content (Faker) is wp acorn seed:cpt / seed:tax from concept-image/wp-make-cpt: this package is for the
content the site will keep.
Requirements
- PHP 8.4+
- Roots Acorn 6.4+
symfony/yaml7.4+ or 8 (installed with the package)- ACF Pro for
acf:values, Polylang forlanguagesandtranslations(both optional)
Installation
In the theme, as a dev dependency (never on production):
composer require --dev concept-image/wp-data-seeder
Quick start
wp acorn data:init # writes database/content.yaml from the site's post types, taxonomies, menus, languages
wp acorn data:seed --dry-run # validates and shows what would be created or updated
wp acorn data:seed # writes
languages: [fr, en] # optional, needs Polylang; first = the language items are written in
page: # level 1: a post type or taxonomy name
- Accueil:
front_page: true
menu: main-nav
translations: { en: Home }
- Nos solutions: # level 2: titles, accents and symbols welcome
menu: main-nav
children:
- Lasers à état solide
- « Électronique » & co:
acf: { intro_text: Cartes et modules }
- Contact: # "Title:" + a list = children
- Plan d'accès
- Mentions légales:
menu: { footer-nav: { order: 9, label: Mentions } }
product-cat: # a taxonomy: nesting = parent term
- Industrie: [Marquage, Découpe]
product:
- "Laser Nd:YAG Q-Smart": # quote titles containing ": " or " #"
status: draft
acf:
commercial_name: Q-Smart 850
key_features: [Haute énergie, Compact]
related_products: [Merion]
terms: { product-cat: [Industrie/Marquage] }
- Merion
options: # ACF options pages
general-options: # options page slug, or a field group name shown on it
phone: 02 96 00 00 00
page_contact: Contact
Format
Items: - Title, - Title: [children], - Title: followed by indented options (or { options }), or
- { title: Title, …options }. Children are always a list: a map under a title is options, so a mistyped option is an
error instead of a new page.
| Option | Applies to | Value |
|---|---|---|
slug | posts, terms | The slug (default: from the title, accents removed). Set it before renaming a title |
status | posts | publish (default), draft, pending, private |
template | posts | A page template file of the theme |
content | posts | Post content (description for terms) |
excerpt | posts | Post excerpt |
order | posts | menu_order (default: position among siblings) |
front_page | pages | true: the static front page |
posts_page | pages | true: the posts page |
acf | posts, terms | ACF field_name: value pairs |
terms | posts | taxonomy: [names], Parent/Child paths; missing terms are created |
menu | posts, terms | A location (main-nav) or menu name, a list, or location: { order, label, parent } |
translations | posts, terms | lang: Title or lang: { title, slug, content, excerpt, acf } |
children | posts, terms | Child items (hierarchical post types and taxonomies) |
ACF values
By field name, written by field key among the groups that apply to the object (page template included), only when the stored value differs.
| Field types | Value |
|---|---|
text, textarea, wysiwyg, email, url, password, oembed, color_picker | text |
number, range | a number (min / max checked) |
select, radio, button_group, checkbox | choice key or label, a list when multiple |
true_false | true / false |
date_picker, date_time_picker, time_picker | 2026-03-15, 15/03/2026, 2026-03-15 14:30, 14:30 |
link | a URL or { url, title, target } |
image, file, gallery | media library file name(s) or attachment ID(s); never downloaded |
post_object, page_link, relationship | titles (items of the file or existing posts, same language) |
taxonomy | term names or Parent/Child; missing terms created, save_terms merged with terms: |
google_map | { address, lat, lng } |
repeater, group, flexible_content | rows by sub-field name (layout: for flexible content) |
clone, user | not supported |
Options pages
options: at level 1, then an ACF options page slug ($slug of an acf-composer Options class) or the name of a
field group shown on that page (Builder::make('general_options')), then field_name: value pairs with the formats
above. Values go to wp_options (the page's post_id, options by default) after posts and terms, so titles resolve.
--only=options seeds them alone.
Menus
A theme location (main-nav, secondary-nav, footer-nav, footer-secondary-nav in wp-starter-theme) gets a menu
named after its label, created and assigned when missing; any other value is a menu name. Items follow the file order
unless order is set, and nest under parent (an item placed earlier in that menu) or the nearest ancestor present in
the same menu.
Translations
With Polylang and languages: [fr, en] at the top, each item is written in the first language and its
translations in the others, linked in Polylang. A translation inherits the item's options and ACF values (its own
acf overrides them), is placed under the translated parent, resolves titles and terms in its language, and goes into
its language's menu ("Menu principal (EN)"), registered in Polylang's menu locations.
Re-runs
A post is matched by its seed key (_wp_data_seeder_key meta), else by post type, parent, slug and language, so
pages created by hand are adopted; a translation through its Polylang link; a term alike; a menu item by menu and
object; an options page value by page and field key. What the file sets is compared and updated when it differs;
nothing is ever deleted or trashed.
Moving an item under another parent in the file, or changing its slug, creates a new object (the parent's slug path
and the slug identify it): move it in the admin first. Set slug: before renaming a title.
The complete reference is resources/claude/skills/wp-data-seeder/references/format.md.
Commands
| Command | Does |
|---|---|
wp acorn data:init [file] [--force] | Writes a starting file (default database/content.yaml), never overwriting one without --force |
wp acorn data:seed [file] [--dry-run] [--only=section] [--force] | Validates the file, then creates or updates; --dry-run writes nothing; --only (repeatable) limits to sections (options for the options pages); asks for confirmation in production (--force skips) |
A relative file is looked up from the current directory, then from the theme. Validation errors list every problem
with the item path, e.g. page › Nos solutions › Électronique: unknown ACF field "intro_txt" (did you mean intro_text?).
Claude Code
wp acorn starter:ai (wp-starter-theme) publishes the package's skill and rules into the project's .claude/, or:
wp acorn vendor:publish --tag=wp-data-seeder-ai
Testing
composer ci
Changelog
See CHANGELOG.
Contributing
See CONTRIBUTING.
Credits
- Banner icon: Isometric icons created by Magnific - Flaticon
License
The MIT License (MIT). See License File.