Article Overview
- Category: Data Safety, Disaster Recovery & Database Integrity
- Audience: Store Owners, Webmasters, Database Administrators & Agencies
- Applies To: NextGen Smart Data Importer (Community Free & Enterprise Pro Editions)
- Purpose: Technical guide explaining the mechanics of NextGen's 1-Click Rollback Engine, entity ledgering, atomic deletion, and zero-orphan media cleanup.
1. Executive Summary
Every developer and store owner has experienced the nightmare of a "bad import":
- Mapped the wrong column to product prices, making thousands of catalog items $0.00.
- Merged spreadsheet data into the wrong custom taxonomy.
- Flooded the Media Library with 5,000 unwanted images.
With legacy WordPress importers, undoing an accidental import requires restoring an entire multi-gigabyte database backup—wiping out all customer orders and user comments placed since the backup occurred.
NextGen Smart Data Importer features a native 1-Click Rollback Engine. Every post, page, product variation, attachment, custom field, and term created during an import is tracked in a forensic session ledger. Clicking Rollback surgically removes all created entities and reverts updated records without touching the rest of your site!
2. Forensic Session Tracking Architecture
3. How to Execute a 1-Click Rollback
From the NextGen React UI:
- Navigate to NextGen Importer ➔ Recent Imports.
- Locate the session you wish to revert.
- In the session card action bar, click
[ ↩ Rollback ]. - A safety confirmation modal appears summarizing the exact blast radius:
CONFIRM SESSION ROLLBACK
Session ID: imp_6afe0ff4119d2
• 997 Posts will be permanently deleted.
• 118 Media attachments will be removed from disk.
• Term taxonomy counts will be automatically refreshed.
[ Cancel ] [ Confirm & Rollback ]- Click Confirm & Rollback. NextGen executes the rollback in batch slices with a real-time countdown progress bar.
4. Zero Orphan Files: Physical Disk Cleanup
A critical flaw in standard WordPress deletion is that removing a post does not automatically delete its associated media files on disk (/wp-content/uploads/).
NextGen's rollback engine executes two-tier physical cleanup:
- Database Layer: Deletes records from
wp_posts,wp_postmeta, andwp_term_relationships. - Physical Disk Layer: Calls
wp_delete_attachment($attachment_id, true). WordPress deletes the original.jpg/.pngfile and all generated thumbnail crops (150x150,300x300,1024x1024, and custom WooCommerce sizes) from your server hard drive, reclaiming 100% of used disk space.
5. Developer Technical Reference
WP-CLI Rollback Command
Roll back any session directly via SSH terminal:
# Roll back a specific import session
wp nextgen rollback imp_6afe0ff4119d2 --yes
# Roll back with verbose audit logging
wp nextgen rollback imp_6afe0ff4119d2 --verboseAction Hook: nextgen_importer_rollback_completed
Fires after all session entities have been rolled back:
add_action('nextgen_importer_rollback_completed', function ($import_id, $summary) {
error_log("Rollback completed for {$import_id}. Deleted {$summary['posts_deleted']} posts.");
}, 10, 2);6. Frequently Asked Questions (FAQ)
Q: Will rollback delete orders placed by customers while the import was running?
No. Rollback strictly queries wp_nextgen_file_records for IDs generated specifically during that single import session. New customer orders, user registrations, and blog comments remain untouched.
Q: Can I roll back an import that was executed several weeks ago?
Yes. As long as the session record exists in Recent Imports, you can roll it back at any time.