Search by

concept-image / wp-data-seeder

concept-image

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

Issues

pkg:composer/concept-image/wp-data-seeder

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

0.2.0 2026-12-04 14:10 UTC

This package is auto-updated.

Last update: 2026-12-04 13:10:32 UTC


README

WP Data Seeder

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/yaml 7.4+ or 8 (installed with the package)
  • ACF Pro for acf: values, Polylang for languages and translations (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.

OptionApplies toValue
slugposts, termsThe slug (default: from the title, accents removed). Set it before renaming a title
statuspostspublish (default), draft, pending, private
templatepostsA page template file of the theme
contentpostsPost content (description for terms)
excerptpostsPost excerpt
orderpostsmenu_order (default: position among siblings)
front_pagepagestrue: the static front page
posts_pagepagestrue: the posts page
acfposts, termsACF field_name: value pairs
termspoststaxonomy: [names], Parent/Child paths; missing terms are created
menuposts, termsA location (main-nav) or menu name, a list, or location: { order, label, parent }
translationsposts, termslang: Title or lang: { title, slug, content, excerpt, acf }
childrenposts, termsChild 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 typesValue
text, textarea, wysiwyg, email, url, password, oembed, color_pickertext
number, rangea number (min / max checked)
select, radio, button_group, checkboxchoice key or label, a list when multiple
true_falsetrue / false
date_picker, date_time_picker, time_picker2026-03-15, 15/03/2026, 2026-03-15 14:30, 14:30
linka URL or { url, title, target }
image, file, gallerymedia library file name(s) or attachment ID(s); never downloaded
post_object, page_link, relationshiptitles (items of the file or existing posts, same language)
taxonomyterm names or Parent/Child; missing terms created, save_terms merged with terms:
google_map{ address, lat, lng }
repeater, group, flexible_contentrows by sub-field name (layout: for flexible content)
clone, usernot 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

CommandDoes
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

License

The MIT License (MIT). See License File.