---
title: "How to Clean Up GravityImport Database Tables"
date: 2026-04-23
author: "GravityKit"
link: "https://www.gravitykit.com/docs/gravityimport/how-to-clean-up-gravityimport-database-tables/"
---

GravityImport uses two database tables to track import progress and enable rollback:

- `wp_gv_importentry_rows` stores a copy of the CSV data for each import batch
- `wp_gv_importentry_log` stores operation logs used for rolling back imports

Over time, especially after large or repeated imports, these tables can grow significantly and take up hundreds of megabytes of database space.

### When is it safe to clean up?

You can safely clean up these tables if:

- All your imports have completed (no imports are currently in progress)
- You don't need to roll back any previous imports

If you have an import currently in progress, do **not** truncate these tables. Doing so will break the active import.

### Step 1: Back up your database

Before making any changes, create a backup of your database. You can do this through your hosting panel (cPanel, phpMyAdmin) or using a plugin like UpdraftPlus. If you have WP-CLI access, you can run:

```
wp db export backup-before-cleanup.sql
```

```
wp db export backup-before-cleanup.sql
```

### Step 2: Truncate the tables

Run the following SQL queries in phpMyAdmin or via WP-CLI:

```
TRUNCATE TABLE wp_gv_importentry_rows;
TRUNCATE TABLE wp_gv_importentry_log;
```

```
TRUNCATE TABLE wp_gv_importentry_rows;
TRUNCATE TABLE wp_gv_importentry_log;
```

If your WordPress installation uses a custom table prefix (something other than `wp_` ), replace `wp_` with your prefix.

Using WP-CLI:

```
wp db query "TRUNCATE TABLE wp_gv_importentry_rows;"
wp db query "TRUNCATE TABLE wp_gv_importentry_log;"
```

```
wp db query "TRUNCATE TABLE wp_gv_importentry_rows;"
wp db query "TRUNCATE TABLE wp_gv_importentry_log;"
```

### Automatic cleanup coming soon

We're working on a built-in cleanup feature that will automatically remove old import data after batches complete. This will be available in a future update.