GravityKit icon

Black Friday Pro

Take 25% off GravityView Pro, All Access, and Lifetime with code BFPRO25.

Shop the Sale
Skip to content
GravityKit
Buy
Sign in
0 items
  • Plugins

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Forms—everything you need to build powerful web apps and workflows.

    Learn more
    • GravityView Pro

      GravityView Pro

      Bestseller

      Get Live Filters, Maps, DataTables, the Advanced Elementor Widget and every other Pro feature to build the app your process needs.

    • GravityView

      GravityView

      Trending

      Display Gravity Forms entries on the frontend of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, PDF, or Google Sheets, then share them with secure links or deliver them to cloud storage on a schedule.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data between sites, including forms, entries, settings, Views, feeds, and file uploads, and import forms from other form plugins.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

    • GravitySearch

      GravitySearch

      Search Gravity Forms entries across every form from one screen.

  • Ideal For

    • Nonprofits
    • Web Agencies
    • Education
    • Developers
    • Small Businesses
    • Startups
    Explore All Use Cases

    Case studies

    • Be There Local
    • Killer Shorts
    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    View All Case Studies
  • Resources

    • Blog
    • Case studies
    • Newsletter
    • GravityKit vs competitors
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy

    Ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Support
  • Pricing
  • Plugins

    • GravityView Pro

      GravityView Pro

      Bestseller

      Get Live Filters, Maps, DataTables, the Advanced Elementor Widget and every other Pro feature to build the app your process needs.

    • GravityView

      GravityView

      Trending

      Display Gravity Forms entries on the frontend of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, PDF, or Google Sheets, then share them with secure links or deliver them to cloud storage on a schedule.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data between sites, including forms, entries, settings, Views, feeds, and file uploads, and import forms from other form plugins.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

    • GravitySearch

      GravitySearch

      Search Gravity Forms entries across every form from one screen.

    View All Products

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Forms—everything you need to build powerful web apps and workflows.

    Learn more
  • Ideal For

    • Nonprofits
    • Web Agencies
    • Education
    • Developers
    • Small Businesses
    • Startups
    Explore All Use Cases

    Case studies

    • Be There Local
    • Killer Shorts
    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    View All Case Studies

    How to build...

    • Client Portal
    • AI-Built Directory
    • Conference Website
    • WordPress CRM
    • Admin Dashboard
    • Inventory Management
    • Vendor Portal
    • Document Library
    View All Guides
  • Resources

    • Blog
    • Case studies
    • Newsletter
    • GravityKit vs competitors
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy

    ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Support
  • Pricing
0 items

Search

Results appear automatically as you type.
Loading results…

results found matching

    Sign in
    Buy

    Docs

    • Docs Home

    Gravity Forms Add-Ons

    • GravityView
    • GravityActions
    • GravityBoard
    • GravityCalendar
    • GravityCharts
    • GravityEdit
    • GravityExport
    • GravityImport
    • GravityMath
    • GravityRevisions
    • GravitySearch
    • GF Widget for Elementor
    • GF Dynamic Lookup
    • GF Entry Tags
    • GF Event Field
    • GravityExport Lite
    • GF Zero Spam
    • GravityMigrate

    GravityView

    • Getting Started
    • View Setup
    • FAQ
    • Pre-Sale
    • Advanced
    • Common Problems
    • Customizing Your Views
    • Edit Entry
    • Entry Approval
    • Filter and Sort Results
    • Gravity Forms
    • Merge Tags
    • Roles and Capabilities
    • Search
    • Shortcodes
    • View Settings
    • WordPress Posts

    General Help

    • Account, Invoices, and Billing
    • License Related
    • Plugins and Settings
    • Agency accounts
    • Contact
    • Docs Home
    • Gravity Forms Add-Ons

      • GravityView
      • GravityActions
      • GravityBoard
      • GravityCalendar
      • GravityCharts
      • GravityEdit
      • GravityExport
      • GravityImport
      • GravityMath
      • GravityRevisions
      • GravitySearch
      • GF Widget for Elementor
      • GF Dynamic Lookup
      • GF Entry Tags
      • GF Event Field
      • GravityExport Lite
      • GF Zero Spam
      • GravityMigrate
    • GravityView

      • Getting Started
      • View Setup
      • FAQ
      • Pre-Sale
      • Advanced
      • Common Problems
      • Customizing Your Views
      • Edit Entry
      • Entry Approval
      • Filter and Sort Results
      • Gravity Forms
      • Merge Tags
      • Roles and Capabilities
      • Search
      • Shortcodes
      • View Settings
      • WordPress Posts
    • General Help

      • Account, Invoices, and Billing
      • License Related
      • Plugins and Settings
      • Agency accounts
    • Contact

    GravityImport

    • Error: “Failed validation” when importing entries
    • Importing entries from the command line with WP-CLI
    • Keeping imported entries in date order
    • “Row #[x] ID does not exist for form” error
    • Adding new fields to an existing form during import
    • Bulk Edit Step: What are these fields?
    • Bulk Edit Step: What will happen to my old field data?
    • Can I import a CSV file on the front-end of my website?
    • Can I import passwords with the GravityImport plugin?
    • Capabilities necessary to import entries
    • Choosing a form for the import
    • Configure import options
    • Continue Processing If Errors Occur
    • Create a new form in Gravity Forms from a CSV
    • Does GravityImport limit the number of entries I can import?
    • Does GravityImport process calculations during import?
    • Does GravityImport support importing Nested Form fields?
    • Error: Arguments not allowed here: rest_route
    • Error: CSV file failed to upload
    • Error: Import has finished with errors (HTTP 404)
    • Error: Server returned an empty response
    • Exporting a CSV from Apple Numbers
    • Exporting a CSV from Google Sheets
    • Exporting a CSV from LibreOffice
    • Exporting a CSV from Microsoft Excel
    • Exporting List fields as JSON
    • Formatting dates for Gravity Forms in Microsoft Excel
    • Getting started with GravityImport: how to import entries into Gravity Forms
    • GravityImport Developer Hooks
    • GravityImport Support for Gravity Forms Add-Ons
    • GravityImport: “The importer encountered an error that prevents it from continuing”
    • How to assign entries to users during import
    • How to change the CSV delimiter
    • How to Clean Up GravityImport Database Tables
    • How to enable pre-release versions of GravityImport
    • How to import data from a MySQL database
    • How to restrict access to Import Entries
    • How to trigger notifications for imported entries
    • Import CSV to Gravity Forms with Import Entries 2.0
    • Import option: Skip Field Validation
    • Import Step: Where would you like to import the entries?
    • Importing dates in UTC timezone
    • Importing Gravity Forms Post Fields from CSV
    • Importing List fields into a new form
    • Importing List fields into existing forms
    • Importing values into Checkboxes fields
    • Mapping CSV columns to form fields
    • Naming your field columns
    • Restarting a Gravity Flow workflow after import
    • Updating existing entries with the GravityImport plugin
    • Uploading a CSV file
    • Home
    • Docs
    • GravityImport
    • Importing entries from the command line with WP-CLI

    Importing entries from the command line with WP-CLI

    Estimated reading: 6 minutes

    Updated on November 6, 2026

    The wp gk import command runs a GravityImport import on the server, from a CSV file and an import profile saved in the WordPress admin. It returns when the import has finished, so a server script or a scheduled task can run imports without anyone opening the importer.

    The command needs WP-CLI on the server and GravityImport 2.11.0 or later. With profiles saved in the import wizard, use 2.12.7 or later. Earlier versions stop with “Form structure has changed since profile was saved” for many forms that haven’t changed, such as forms with Checkbox, Multiple Choice, Time, or Date fields.

    Save an import profile #

    The command takes the column mapping from an import profile: a JSON file with the mapping and the import options from the importer’s Configure step.

    To make one, import a file with the same columns in the WordPress admin, as described in Getting started with GravityImport. When the import finishes, click Download Import Profile on the Import Complete screen.

    The Import Complete screen of the GravityImport importer, with the Download Import Profile button outlined in red between View Imported Records and Start New Import

    The same button is next to Continue With Import on the Map Fields and Configure steps. A profile saved at the end comes from an import you have seen work, so that is the one to keep.

    Copy the profile to the server where you run WP-CLI. The same file also works in the browser: Load Import Profile on the Map Fields step applies it to an import there, as Mapping CSV columns to form fields describes.

    Run an import #

    From the folder with the files, pass the CSV file and the profile to wp gk import run:

    wp gk import run --file=volunteers.csv --profile=volunteer-roster-profile.json

    When the import is done, the command prints a summary:

    Creating import batch for Form #48...
    Batch #271 created. Processing...
    Status: done
    Success: Import complete: 7 entries imported from 7 rows.

    File paths can be relative to the folder you run the command from, or absolute.

    Add --user with a WordPress username, such as --user=admin, to record that user as the creator of the new entries. Without it, the entries have no creator, the same as entries submitted by a visitor who isn’t logged in.

    When some rows fail, the command imports the rest and ends with a warning instead of the success line:

    Warning: Import finished with errors: 1 imported, 0 skipped, 1 rows had errors out of 2 rows.

    That follows the profile’s Continue Processing If Errors Occur option, which is on by default. A profile saved with it turned off makes the command stop with an error at the failed row.

    These options are available:

    OptionWhat it does
    --fileThe CSV file to import. Required.
    --profileThe import profile. Required.
    --userThe WordPress user recorded as the creator of the new entries.
    --form-idImports into this form instead of the one the profile was saved for, such as a copy made with Duplicate in the Gravity Forms forms list.
    --dry-runRuns the checks and prints a summary without importing anything.
    --forceImports even when the form has changed since the profile was saved.
    --formatThe output format: table (the default), json, csv, or yaml.

    Check a profile before a run #

    wp gk import validate takes the same --file and --profile and checks them without importing anything:

    wp gk import validate --file=volunteers.csv \
      --profile=volunteer-roster-profile.json
    Profile structure is valid.
    Form #48 exists: Volunteer Roster
    Form structure matches profile.
    Column matching: 5 matched, 0 unmatched.
    5 schema rules mapped successfully.
    Success: Profile validation complete.

    The output confirms that the profile can be read, that the form exists and still matches the profile, and how many of the profile’s columns were found in the file. Run it before the first scheduled import, and again whenever the file or the form changes.

    How the columns are matched #

    The command matches the file’s columns to the profile by their header names, so the columns can come in a different order from the file the profile was saved with. The match ignores capital letters and spaces at either end of a header.

    When a header isn’t found, the command uses the column in the same position as in the original file, unless another header already matched that column. A profile column with no match is left out. The run warns about it, and that field stays empty on the new entries:

    Warning: 1 profile column(s) could not be matched to the CSV.

    When the form changes #

    A profile also records the form’s fields as they were when it was saved. The form counts as changed when, since then, a field has been:

    • added or deleted
    • changed to another field type
    • made required, or no longer required
    • given another choice, on a Checkbox field

    These changes don’t count:

    • editing a field’s label
    • moving a field on the form
    • editing a Drop Down field’s choices
    • renaming a Checkbox choice
    • changing the format of a Date, Time, or Phone field
    • changing a Date field’s Date Input Type

    After a change, run stops before it imports anything, and so does run --dry-run:

    Error: Form structure has changed since profile was saved. Use --force to proceed anyway.

    validate reports the same change as a warning and finishes its checks. It also warns about each mapped field that was deleted or has a different type:

    Warning: The "Department" column (CSV column 3) is mapped to the "Department" field (field ID 3), which was a select field when the profile was saved and is now a radio field. Check that the column still fits the field, or map it again in the import wizard and save a new profile.
    Warning: Form structure has changed since profile was saved.

    To bring the profile up to date, import a file in the WordPress admin again and download a new profile. --force runs the import with the old profile instead.

    Warning: With --force, columns mapped to deleted fields are skipped, and every other column goes into the field the old mapping names. Read the warnings from validate before you use it.

    Dates split across columns #

    A profile saved with GravityImport 2.12.6 or earlier can map columns to the month, day, or year of a Date field. Such a profile stops both run and validate, because Gravity Forms saves one whole date on the field:

    Error: The "Start date (MM)" column (CSV column 3) is mapped to the MM part (input 4.1) of the "Start date" Date field, but Gravity Forms saves one whole date on that field, so the column would not be imported. Map a column that holds the whole date to the "Start date" field (field ID 4) instead.

    Combine the parts into one date column, map it to the Date field in the import wizard, and download a new profile. With --format=json, the record’s code is gravityview/import/errors/date_input_rule and the exit status is 1.

    Use the command in a script #

    With --format=json, run and validate print one JSON record instead of the lines above:

    wp gk import run --file=volunteers.csv \
      --profile=volunteer-roster-profile.json --format=json
    [{"batch_id":278,"status":"done","total":2,"imported":1,"skipped":0,"errors":1,"last_error":""}]

    An import where some rows failed still exits with status 0, so a script should read errors from the record. The exit status is 1 when the command stops, such as for a missing file or a changed form. The record then has "status":"error", a code and a message:

    [{"status":"error","code":"csv_not_found","message":"CSV file not found or not readable: volunteers-new.csv"}]
    Still stuck? How can we help?

    How can we help?

    "*" indicates required fields

    This field is for validation purposes and should be left unchanged.
    Replies will go to this email.
    How can we help?*
    My pre-sale question is related to...*
    My WordPress skills are....*
    My Gravity Forms skills are...*
    You will be shown articles from our documentation.
    Vous pouvez nous écrire dans votre langue maternelle si c’est plus facile pour vous—nous nous occuperons de la traduction!
    Puedes escribirnos en tu idioma nativo si te resulta más fácil; ¡nosotros nos encargamos de la traducción!
    Sie können uns in Ihrer Muttersprache schreiben, wenn das für Sie einfacher ist – wir kümmern uns um die Übersetzung!
    U kunt ons in uw moedertaal schrijven als dat gemakkelijker voor u is — wij zorgen voor de vertaling!
    Du kan skrive til oss på ditt morsmål hvis det er enklere for deg — vi tar oss av oversettelsen!
    Du kan skriva till oss på ditt modersmål om det är lättare för dig — vi tar hand om översättningen!
    Você pode nos escrever em seu idioma nativo se for mais fácil para você — nós cuidaremos da tradução!
    Puoi scriverci nella tua lingua madre se ti è più facile — penseremo noi alla traduzione!
    Please provide as much detail as you're able; this helps us provide you with faster support.
    Drop files here or
    Accepted file types: jpg, jpeg, gif, png, tiff, pdf, bmp, zip, json, csv, xls, xlsx, Max. file size: 256 MB.
      Get better at Gravity Forms every Friday

      Was this page helpful?

      Table Of Contents
      • Save an import profile
      • Run an import
      • Check a profile before a run
      • How the columns are matched
      • When the form changes
      • Dates split across columns
      • Use the command in a script
      GravityKit
      • How to Build It
      • GravityKit vs competitors
      • Pricing
      • Products
      • Our Team
      • Our Values
      • Work With Us
      • Partner Directory
      • Coupons
      Support
      • Support
      • Contact
      • Documentation
      • Scope of Support
      • Brand Guidelines
      • Brand Kit
      • Privacy Policy
      • Terms of Service (“Terms”)
      I am a...
      • Nonprofit
      • Web agency
      • Small business owner
      • Web developer
      • Educational institution
      • WordPress freelancer
      • Startup founder
      • One-person agency
      Get notified of updates.

      We’re constantly improving GravityKit. Fill out your email below and we’ll notify you anytime major updates drop.

      See past editions
      • Facebook
      • Twitter
      • Mastodon
      GravityKit is a Gravity Forms Certified Developer.

      Copyright © 2026, Katz Web Services, Inc.

      GravityKit and GravityView are registered trademarks of Katz Web Services, Inc.

      Before you go

      Take 25% off

      Our Black Friday sale covers GravityView Pro, the All Access Pass and the Lifetime All Access Pass, and ends December 1.

      See the Deals