For big businesses dealing with lots of orders, deleting old invoice numbers is really helpful. It fixes mistakes, makes the system faster, and saves time when searching for invoices. The WebToffee’s WooCommerce PDF Invoices, Packing Slips, and Credit Notes plugin allows store owners to delete existing invoice numbers. Store owners can do this in two ways:
- Using a custom tool. The steps for deletion are as follows:
- Navigate to the Invoice settings page.
- Clear all the order statuses selected under Automate invoice creation.
- Navigate to WooCommerce > Status > Tools.
- Perform the deletion using the Delete all generated invoice numbers tool.
- Using a custom code snippet. The steps for deletion are as follows:
- Add the custom code snippet to the WordPress site in use.
- Refresh the WooCommerce Orders listing page.
- Once done with the deletion, remove the custom code snippet from the WordPress site.
Deleting invoice numbers using the custom tool
To delete all the existing invoice numbers:
- Navigate to Invoice/Packing > Invoice > General.
- Under the General section, head to the Automate invoice creation option.

- Clear all the order statuses selected under the Automate invoice creation option.
- Click on Update Settings.
- Now, head to WooCommerce > Status > Tools
- Under the Tools tab, navigate to the Delete all generated invoice numbers tool.
- Click on the Delete button present against the tool. On clicking the Delete button a confirmation window will pop up.
- Click on OK and run the tool.
Deleting invoice numbers using a custom code snippet
You can delete existing invoice numbers using a custom code snippet. Follow these steps:
- Add the custom code snippet given below to your WordPress site.
- Add it to the active child theme’s functions.php file or use a third-party plugin for the addition. To know more, check out the following article: To know more about how to add a custom code snippet using a third-party plugin, refer to this article: Adding Custom Codes with a Third-Party Plugin.
delete_post_meta_by_key( 'wf_invoice_number' );
- On adding the code, refresh the WooCommerce Orders listing page and make sure that the existing invoice numbers are deleted.
- After deleting the invoice numbers, remove the custom code snippet from your WordPress site.
Note:
Removing the custom code snippet from the WordPress site is crucial for setting up invoice numbers for upcoming orders.
- To learn more about creating invoice numbers for upcoming orders, refer to the following article: Create Invoice Numbers for Upcoming Orders.