← Back to help center

WP-CLI commands

GiveFlow includes four WP-CLI commands for database management, data seeding, and aggregate maintenance. All commands use the wp giveflow namespace.

Prerequisites

You need WP-CLI installed and accessible from your terminal. Run all commands from your WordPress root directory or use the --path flag to specify it.

Available commands

wp giveflow migrate

wp giveflow migrate

Runs all pending database migrations. GiveFlow runs them for you on activation and after a version bump, so you only need this command when that did not happen.

When to use it:

  • After a plugin update that includes database changes
  • During initial setup if automatic migration did not complete

wp giveflow recompute-aggregates

wp giveflow recompute-aggregates

Recalculates all aggregate columns for donors, funds, campaigns, and forms. This rebuilds cached totals like total raised, donation count, and donor counts from the raw donation data.

Options:

Option Default Description
--scope=<scope> all Limit the rebuild to donors, funds, campaigns, or forms.

When to use it:

  • After importing donations directly into the database
  • If dashboard totals appear incorrect
  • After restoring a database backup

wp giveflow seed

wp giveflow seed

Creates fake test donations, and the donor records behind them, on a campaign you already have. Paid dates are spread over the last 90 days or so, so the dashboard and its charts have something to show. It does not create campaigns or forms, so run onboarding first.

Options:

Option Default Description
--donations=<n> 20 How many paid donations to create.
--yes Skip the confirmation prompt.

When to use it:

  • On a fresh installation when you want to explore the interface
  • On a staging site for demonstration purposes

Important: This command requires org-wide test mode. If test mode is off in GiveFlow > Settings > Payments, it refuses to run. Everything it creates is flagged as test data and is excluded from your reporting.

wp giveflow e2e-seed

wp giveflow e2e-seed

Seeds data specifically for end-to-end tests. This creates a predictable, controlled dataset that automated test suites expect.

When to use it:

  • Before running GiveFlow’s end-to-end test suite
  • In a CI/CD pipeline that runs automated tests

Important: This command is intended for development and testing environments only. Never run it on a production site.