Skip to content

CLI Commands, Seeding & Troubleshooting

Entries registers 11 commands in processwire-console (php vendor/bin/wire). Every command supports --json for CI pipelines and deployment scripts.

Command Purpose Example
make:entry Scaffold a Single, Collection, Block, Fieldset, or Managed Table blueprint (--class, --sync, --dir) php vendor/bin/wire make:entry rates --kind=collection --class
entries:types List blueprints, sync index signatures (--sync), or emit TypeScript .d.ts (--typescript) php vendor/bin/wire entries:types --type=rates --json
entries:reindex Rebuild entries_index for one blueprint or all blueprints php vendor/bin/wire entries:reindex --type=rates
entries:clear Clear L1/L2 EntryCache and compiled schema caches php vendor/bin/wire entries:clear --type=rates
entries:seed Populate starter records declared in blueprints (--mode=skip|upsert|replace) php vendor/bin/wire entries:seed --type=rates --mode=upsert
entries:schedule Process due publish_from and publish_until transitions php vendor/bin/wire entries:schedule --json
entries:export Export entries, media, and Managed Tables (--without-media, --tables, --include-tables) to json, csv, ics, or zip php vendor/bin/wire entries:export backups/entries.zip --format=zip --include-tables
entries:import Import JSON, ZIP, or CSV archives (--mode=skip|upsert|replace, --map, --preview, --without-media) php vendor/bin/wire entries:import backups/entries.zip --mode=upsert
entries:tables:sync Preview (--dry-run) or apply additive DDL changes for Managed Tables (--owner=..., --table=...) php vendor/bin/wire entries:tables:sync --dry-run --json
entries:attach-fieldset Attach an embedded @fieldset:* or pivot blueprint to a ProcessWire page template (--style, --pivot-blueprint, --label, --selector, --columns, --searchable, --allow-user-template) php vendor/bin/wire entries:attach-fieldset --blueprint=seo --template=page --field=seo --dry-run --json
entries:doctor Audit database tables, index parity, orphaned media, and schema drift (--fix --force) php vendor/bin/wire entries:doctor --json

Define starter records directly in YAML or point to an external PHP/YAML seed file:

site/entries/collections/seasons.yaml
seed:
- code: LOW
title: Low Season
rate_multiplier: 0.85
- code: HIGH
title: High Season
rate_multiplier: 1.45
is_peak: true

Use --mode=skip in deployments to insert missing records without overwriting editorial changes, or --mode=upsert to update matching records by unique key.

Export and import entries, isolated media, multi-language CSV columns (<field>__<langName>), ICS calendar feeds, and Managed Tables directly from PHP without buffering huge datasets in RAM:

<?php
declare(strict_types=1);
namespace ProcessWire;
$entries = $this->wire()->entries;
// Stream JSON, CSV, ICS, or full ZIP backup (including Managed Tables)
$entries->exportJsonToFile('backups/entries.json', ['includeTables' => true]);
$entries->exportCsvToFile('seasons', 'backups/seasons.csv');
$icsCalendar = $entries->exportIcs('events');
$entries->exportArchive('backups/full-backup.zip', ['includeTables' => true]);
// Preview and import CSV (honors field ACLs and <field>__<langName> columns)
$preview = $entries->previewCsv('seasons', $csvContent);
$stats = $entries->importCsv('seasons', $csvContent, ['mode' => 'upsert']);
// Inspect activity log and clear caches
$recentEvents = $entries->getActivityLog(limit: 50, type: 'seasons', action: 'saved');
$entries->clearCache('seasons');

A newly added field returns no matches in $entries->find()

Section titled “A newly added field returns no matches in $entries->find()”
  1. Confirm the field has index: true in its blueprint file.
  2. Clear cached schemas and rebuild the index:
    Terminal window
    php vendor/bin/wire entries:clear --json
    php vendor/bin/wire entries:reindex --type=your_blueprint

Scheduled entries are not publishing automatically

Section titled “Scheduled entries are not publishing automatically”

Verify that your blueprint includes publishable: true and that your server crontab runs entries:schedule (or ProcessWire’s schedule:run) every minute:

crontab
* * * * * cd /path/to/processwire && php vendor/bin/wire entries:schedule >/dev/null 2>&1

Non-superuser editors cannot see Setup -> Entries

Section titled “Non-superuser editors cannot see Setup -> Entries”

Check Access -> Roles and verify the role has entries-single, entries-collection, or entries-admin, plus any custom permission declared in the blueprint’s permission or permissions: map.

Diagnosing schema drift, orphaned rows, or unreferenced media

Section titled “Diagnosing schema drift, orphaned rows, or unreferenced media”

Run the diagnostic report before applying automated fixes:

Terminal window
php vendor/bin/wire entries:doctor --json

Next steps