Delete test orders and junk data from Magento 2 safely. Panth Order Cleanup adds a delete button to every order view page, a mass delete action in the order grid, double confirmation with order ID verification, configurable safety controls over which data gets removed, and a permanent audit log that records every deletion.
Product page: kishansavaliya.com/magento-2-order-cleanup.html
What is Panth Order Cleanup? It is a Magento 2 extension that adds safe order deletion to the admin. Magento does not ship with order deletion. This module adds it with seven layers of safety controls so you can clean up test orders and junk data without risking real transactions.
What does it add to my store?
- A delete button on every order view page with configurable text and color.
- A mass delete action in the order grid for bulk cleanup.
- A double confirmation modal that requires typing the exact order number before deletion proceeds.
- Configurable safety controls over which related data (invoices, shipments, credit memos, payment transactions) gets removed.
- A permanent deletion audit log that records who deleted what, when, from which IP address, and by which method.
Which themes are supported? This is an admin-only module. It works the same on any frontend theme, whether Hyva, Luma, or custom.
What does it need? Magento 2.4.4 to 2.4.8, PHP 8.1 to 8.4, and the free mage2kishan/module-core package.
Get a free quote for your project in 24 hours for custom modules, Hyva themes, performance work, M1 to M2 migrations, and Adobe Commerce Cloud.
|
Top Rated Plus on Upwork 100% Job Success - 10+ Years Magento Experience Adobe Certified - Hyva Specialist |
Magento Development Team Custom Modules - Theme Design - Migrations Performance - SEO - Adobe Commerce Cloud |
Visit our website: kishansavaliya.com | Get a quote: kishansavaliya.com/get-quote
- Who Is It For
- Key Features
- Compatibility
- Installation
- Configuration
- How It Works
- Deletion Audit Log
- FAQ
- Support
- About Panth Infotech
- Quick Links
- Stores that ran test orders during development and want to clear them before going live, without leaving dummy data in reports.
- Merchants who received spam or fraud orders and need a clean audit trail showing those records were intentionally removed.
- Developers and agencies who set up staging stores and need a quick way to clear order history between test runs.
- Store owners who want control over which admin users can delete orders, mass delete, and view the deletion log, all through Magento's ACL.
- Any Magento store that has accumulated junk data over time and wants a safe, logged way to remove it.
- Configurable delete button added to every order detail page, with custom text and color set from admin config.
- Confirmation modal shows all data that will be removed before anything is deleted.
- Type-to-confirm requires the admin to type the exact order increment ID before the delete button becomes active, the same pattern GitHub uses for repository deletion.
- Mass delete action added to the order grid so you can select multiple orders and remove them in one step.
- Confirmation dialog before mass deletion, so selections can be reviewed.
- Configurable safety limit caps how many orders can be deleted in a single mass action (default: 50).
- Choose what gets deleted alongside the order: invoices, shipments, credit memos, and payment transactions are each individually toggleable.
- Restrict by order status so only orders with certain statuses (for example, Pending or Canceled) can be deleted. Processing or Complete orders stay protected.
- Quote cleanup removes the associated quote and its items, addresses, payment, and shipping rates.
- Every deletion is logged to the
panth_order_deletion_logtable with order details, customer name and email, grand total, status at deletion, admin username, IP address, deletion method (single or mass), and timestamp. - Log persists after deletion, so the record remains for accounting and compliance even after the order data is gone.
- Accessible from the admin menu under Panth Infotech > Order Cleanup > Deletion Log.
- Seven layers of protection: ACL permissions, confirmation modal, type-to-confirm, status restrictions, mass delete limit, database transactions with rollback, and the permanent audit log.
- Database transactions wrap every deletion. If any step fails, everything rolls back, so partial deletions cannot happen.
- Three ACL resources control access separately: single order deletion, mass deletion, and log viewing.
- No storefront code is added. This module has zero impact on your frontend performance or theme.
- Works with any frontend theme including Hyva and Luma.
- Translation ready using Magento's
__()function.
Select multiple orders and choose "Delete Orders (Permanent)" from the mass actions dropdown.
A configurable "Delete This Order" button appears on every order detail page.
Type the order number to confirm - prevents accidental deletions.
Every deletion is logged with order details, admin user, IP address, method, and timestamp.
Full control over button appearance, safety requirements, allowed statuses, and mass delete limits.
| Requirement | Versions Supported |
|---|---|
| Magento Open Source | 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8 |
| Adobe Commerce | 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8 |
| Adobe Commerce Cloud | 2.4.4 to 2.4.8 |
| PHP | 8.1.x, 8.2.x, 8.3.x, 8.4.x |
| Frontend Theme | Any (admin-only module) |
| Required Dependency | mage2kishan/module-core (free) |
composer require mage2kishan/module-order-cleanup
bin/magento module:enable Panth_Core Panth_OrderCleanup
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush- Download the latest release from Packagist or from the product page.
- Extract it to
app/code/Panth/OrderCleanup/in your Magento install. - Make sure
Panth_Coreis installed too (required dependency). - Run the commands above starting from
bin/magento module:enable.
bin/magento module:status Panth_OrderCleanup
# Expected: Module is enabledAfter install, open:
Admin -> Sales -> Orders (mass delete action in the grid)
Admin -> any order view (delete button on the page)
Admin -> Panth Infotech -> Order Cleanup -> Deletion Log
Admin -> Stores -> Configuration -> Panth Extensions -> Order Cleanup
Go to Stores -> Configuration -> Panth Extensions -> Order Cleanup.
| Setting | Group | Default | Description |
|---|---|---|---|
| Enable Order Cleanup | general | Yes | Master toggle for all order deletion features. |
| Setting | Group | Default | Description |
|---|---|---|---|
| Show Delete Button on Order View | button | Yes | Add a delete button to every order detail page. |
| Button Text | button | Delete This Order | Text shown on the delete button. |
| Button Color | button | #DC2626 | Hex color for the delete button background. |
| Setting | Group | Default | Description |
|---|---|---|---|
| Require Confirmation Modal | safety | Yes | Show a confirmation popup before deleting any order. |
| Require Typing Order ID to Confirm | safety | Yes | Admin must type the exact order increment ID before deletion is allowed. |
| Delete Related Invoices | safety | Yes | Also delete all invoices tied to the order. |
| Delete Related Shipments | safety | Yes | Also delete all shipments tied to the order. |
| Delete Related Credit Memos | safety | Yes | Also delete all credit memos tied to the order. |
| Delete Related Payment Transactions | safety | Yes | Also delete all payment transactions tied to the order. |
| Keep Deletion Log | safety | Yes | Log every deletion with order details, admin user, IP address, and timestamp. |
| Allowed Order Statuses for Deletion | safety | canceled, closed, holded, pending, fraud | Only orders with these statuses can be deleted. Leave empty to allow all statuses. |
| Setting | Group | Default | Description |
|---|---|---|---|
| Enable Mass Delete Action | mass_action | Yes | Add a delete option to the mass actions dropdown in the order grid. |
| Require Confirmation for Mass Delete | mass_action | Yes | Show a confirmation dialog before mass deleting orders. |
| Maximum Orders Per Mass Action | mass_action | 50 | Cap on how many orders can be deleted in a single mass action. |
- Admin opens an order detail page.
- Clicks the Delete This Order button.
- Confirmation modal appears showing all data that will be removed.
- Admin types the order increment ID to confirm (if that setting is on).
- Clicks Yes, Permanently Delete.
- Module checks: module enabled, order status allowed, ACL permission present.
- A database transaction begins.
- Related data is deleted in this order: invoices, shipments, credit memos, payment transactions, order items, addresses, payments, status history, tax, and quote data.
- The order and its order grid record are deleted.
- Transaction is committed.
- Deletion is written to the audit log.
- Admin is redirected to the order grid with a success message.
- Admin selects orders in the order grid.
- Chooses Delete Orders (Permanent) from the mass actions dropdown.
- Confirmation dialog appears with a warning.
- Module checks the safety limit (default: 50 orders maximum).
- Each order is processed through the same single-deletion flow.
- A summary message reports success and failure counts.
Open Panth Infotech -> Order Cleanup -> Deletion Log to view all deletions.
The log is stored in the panth_order_deletion_log table and captures:
| Field | Description |
|---|---|
| Order # | The deleted order's increment ID. |
| Customer | Customer name at time of deletion. |
| Customer email address. | |
| Grand Total | Order total with currency. |
| Status at Deletion | Order status when it was deleted. |
| Items | Number of items in the order. |
| Invoices Deleted | Whether invoices were also deleted. |
| Shipments Deleted | Whether shipments were also deleted. |
| Deleted By | Admin username who performed the deletion. |
| Method | "single" from the order view, or "mass" from the grid. |
| IP Address | Admin user's IP address. |
| Deleted At | Exact timestamp of deletion. |
The log persists permanently. Even after order data is gone, the log record remains for accounting, compliance, and dispute resolution.
Yes. The module includes seven layers of safety controls: ACL permissions, confirmation modal, type-to-confirm, status restrictions, mass delete limit, database transactions with automatic rollback, and a permanent audit log. It was designed with production use in mind.
No. Deletion is permanent. The module keeps a snapshot in the deletion log (customer name, email, totals, item count, timestamps), which can serve as an audit record. There is no undo. Back up your database before using this on a store with real order history.
No. The module only removes from core Magento sales and quote tables. Records added by other extensions (ERP sync logs, custom shipping tables, etc.) may be left as orphaned rows. Check with your other extension vendors if this matters.
Yes. Deleted orders are no longer in Magento reports because the data no longer exists. The deletion log can serve as an alternative record for accounting purposes.
Yes. The module registers three separate ACL resources. Assign them per role under System -> Permissions -> User Roles:
Panth_OrderCleanup::delete_orderfor the single delete button.Panth_OrderCleanup::mass_deletefor mass deletion from the grid.Panth_OrderCleanup::view_logfor viewing the deletion log.
Yes. This is an admin-only module. It has no frontend code, so it works the same regardless of which storefront theme you use.
The entire deletion rolls back. Every deletion is wrapped in a database transaction, so either all related data is removed cleanly, or nothing changes at all. An error message is shown and the system log has the details.
Yes. The Button Text and Button Color fields in the Delete Button group under Configuration let you set any text and any hex color for the button.
Yes. There is a cron job that sends a periodic heartbeat check. It does not auto-delete any orders. All deletions are always manual admin actions.
| Channel | Contact |
|---|---|
| Product Page | kishansavaliya.com/magento-2-order-cleanup.html |
| kishansavaliyakb@gmail.com | |
| Website | kishansavaliya.com |
| +91 84012 70422 | |
| GitHub Issues | github.com/mage2sk/module-order-cleanup/issues |
| Upwork (Top Rated Plus) | Hire Kishan Savaliya |
| Upwork Agency | Panth Infotech |
Response time: 1-2 business days.
Looking for custom Magento module development, Hyva theme work, store migrations, or performance tuning? Get a free quote in 24 hours:
Built and maintained by Kishan Savaliya (kishansavaliya.com), a Top Rated Plus Magento developer on Upwork with 10+ years of eCommerce experience.
Panth Infotech is a Magento 2 development agency that builds high quality, security focused extensions and themes for both Hyva and Luma storefronts. The extension suite covers SEO, performance, checkout, product presentation, customer engagement, and store management, with each module built to MEQP standards and tested across Magento 2.4.4 to 2.4.8.
Browse the full extension catalog on our Magento extensions page or on Packagist.
| Resource | Link |
|---|---|
| Product Page | magento-2-order-cleanup.html |
| Packagist | mage2kishan/module-order-cleanup |
| GitHub | mage2sk/module-order-cleanup |
| Website | kishansavaliya.com |
| Free Quote | kishansavaliya.com/get-quote |
| Upwork (Top Rated Plus) | Hire Kishan Savaliya |
| Upwork Agency | Panth Infotech |
| kishansavaliyakb@gmail.com | |
| +91 84012 70422 |
Need to clean up test orders from your Magento store?
SEO Keywords: magento 2 delete orders, magento 2 order cleanup, magento 2 order cleanup extension, magento 2 remove test orders, magento 2 mass delete orders, magento 2 order deletion extension, magento 2 delete invoices shipments, magento 2 order audit log, magento 2 order management extension, magento 2 delete order safely, magento order cleanup module, magento 2 double confirmation delete, magento 2 order status restriction, magento 2 acl order delete, magento delete order admin, magento 2 order deletion log, panth order cleanup, panth infotech, mage2kishan order cleanup, hire magento developer, top rated plus upwork, kishan savaliya magento, custom magento development, magento 2.4.8 delete orders, php 8.4 magento order cleanup




