This documentation is for the older version of the WooCommerce PDF Invoices, Packing Slips, Delivery Notes, and Shipping Labels plugin. If you are using the new version of the plugin, please note that this documentation no longer applies to you. Find the relevant documentation from here :

WooCommerce PDF Invoices, packing slips and credit notes plugin | WooCommerce Shipping labels, Dispatch labels and Delivery notes plugin | WooCommerce Address labels plugin | WooCommerce Picklists plugin | WooCommerce Proforma invoices plugin | Customizer for WooCommerce PDF Invoices

How to Reset/Delete Existing Invoice Numbers

Last updated on November 12, 2024

The invoice number is one of the most important components of an invoice. Every invoice should possess a unique invoice number assigned sequentially for easy auditing. 

However, if you have a large number of orders that you may not want anymore, you can delete the invoice numbers of those orders and reuse the same invoice number on new ones. 

For example, say you have a thousand order invoices with invoice numbers from 1 to 1000 and you have already completed its auditing. You can delete the invoice numbers of these invoices and reset the invoice counter to 1. This way, the next invoice generated will have an invoice number of 1 instead of 1001. 

Let us see how we can delete the existing invoice numbers using the WebToffee plugin – PDF Invoices and Packing Slips Plugin for WooCommerce.

Delete or Reset WooCommerce Invoice Numbers

The existing invoice numbers generated with the plugin ‘WooCommerce PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels’ can be deleted using a custom tool or via a code snippet.

Delete invoice number using a custom tool 

To delete all the existing invoice numbers, 

1. Navigate to Invoice/Packing > Invoice > General.

2. Remove all the order statuses selected under the Create invoice automatically.

create invoice automatically with plugin

3. Go to WooCommerce > Status > Tools from your WordPress admin dashboard. 

4. Scroll down to Delete all generated invoice numbers and click on Delete

Delete all generated invoice numbers in WooCommerce

Deleting invoice number via code

To remove all the invoice numbers generated,

  1. Make sure that the Create invoice automatically field under Invoice/Packing > Invoice > General is empty.
  2. Remove order statuses for invoice generation
  3. Add the following code to the end of the active theme’s functions.php file.
    delete_post_meta_by_key( 'wf_invoice_number' );
  4. delete invoice with code
    Delete code added at the end of the functions.php file
  5. Now, remove the code delete_post_meta_by_key( ‘wf_invoice_number’ ); placed in the active theme’s functions.php to proceed (This step is mandatory).

Alternative method

The plugin stores the invoice number under the meta key wf_invoice_number and is contained in the table wp_postmeta. If you have access to the SQL DB of your website you can delete it with an SQL query.

To reset and generate a different invoice number for the orders, refer to the article on creating/resting WooCommerce invoice numbers