The ultimate guide to Woocommerce delete all orders

Bulk delete all orders
Table of Contents

If you have a big online store where hundreds of orders are registered daily, using a technique for woocommerce delete all orders in bulk is required to prevent slowing down your website performance and better management of new orders.

Although, it is possible to manually bulk delete orders woocommerce, you can make the process faster and easier by woocommerce order plugin.

In this tutorial, we want to show you how to delete all orders woocommerce with three practical methods:

If you try to delete all woocommerce orders with SQL or Manually, you can have some problems like the limited options for filtering orders. Moreover, you have to spend lots of time to insert the SQL code or follow the steps in the default editor of WooCommerce. That’s why we want to show you how to delete orders quickly using the WooCommerce orders bulk edit plugin.

Why Do you need to delete all wooCommerce orders?

As an e-commerce business owner, getting a lot of orders is good news. However, WooCommerce orders are stored on your site’s database, so it is essential to clean the database regularly to optimize your online store performance.

At first, this issue may not seem very important, but after a few months and with the increase of the database size, the speed of your site will decrease significantly. For this reason, if you receive a large volume of orders on your site, you must use WooCommerce bulk delete orders tools to remove the old orders and solve this problem.

On the other hand, with a large number of orders on your site, you may face a lot of problems in managing them. So, to manage new orders efficiently, it is better to let WooCommerce delete old orders.

By default, you can edit or delete these orders in WooCommerce. However, removing orders one by one in WooCommerce is a difficult and time-consuming task. If you want to let WooCommerce delete all orders, you can do it quickly and easily with the help of the methods we introduce in this post.

How to delete all orders in wooCommerce?

If you have a big e-commerce store where hundreds of online orders are registered daily, the easiest way to delete all orders in WooCommerce is to bulk delete orders woocommerce through one of the following methods:

Let’s check out each method in more detail.

1.Woocommerce remove all orders with SQL

To delete orders with SQL queries, you must first log in to your phpMyAdmin to access your site’s database. To enter the database through phpMyAdmin, you must access the website’s cPanel. After logging in, you must click on phpMyAdmin. 

enter phpmyadmin cpanel to delete orders in SQL queries
Woocommerce delete all orders from database

After logging into phpMyAdmin, you need to find your website database.

Depending on your WordPress database, the desired table can have different prefixes, but it is “wp_” by default.

phpmyadmin databases
Woocommerce delete order programmatically

Selecting your site’s database, go to the SQL tab. In this section, you can enter the following codes in the query for bulk deletion of orders.

Important Note: If you want to use the SQL method to Woocommerce bulk delete orders, backup your database before running the codes.

WooCommerce remove all orders and move to trash

To Woocommerce remove all orders and move them to trash using this SQL code:

UPDATE wp_posts SET post_status = 'trash' WHERE post_type = 'shop_order';

After entering this code, click the Go button to move all orders to trash.

delete all orders from database using sql
Woocommerce delete all orders sql

If you want to delete orders permanently, you must enter the WordPress dashboard and go to the following path:

WooCommerce > Order > Trash

Then delete them forever by selecting all orders and the Delete Permanently option.

delete permanently woocommerce order by default form

Bulk delete all from trashed wooCommerce orders permanently

If you want to permanently delete all your WooCommerce trashed orders, use this SQL code:

DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE post_type = 'product' AND post_status = 'trash' );
DELETE FROM wp_posts WHERE post_type = 'product' AND post_status = 'trash';

Bulk delete orders woocommerce based on status

To delete orders that have a special status, you can enter the following code:

UPDATE wp_posts SET post_status = 'trash' WHERE post_type = 'shop_order' AND post_status = 'wc-completed'

By entering this code in the SQL query, only orders in Complete status will be moved to Trash. To remove other statuses, you can copy the following values instead of ‘wc-completed’:

  • wc-completed
  • wc-pending
  • wc-processing
  • wc-on-hold
  • wc-cancelled
  • wc-refunded
  • wc-failed

If you want to delete orders that have different statuses at the same time, you can use the following code:

UPDATE wp_posts
SET post_status = 'trash'
WHERE post_type = 'shop_order'
AND post_status IN ('wc-pending', 'wc-processing', 'wc-on-hold', 'wc-cancelled', 'wc-refunded', 'wc-failed')

Bulk delete all wooCommerce order notes

By entering the following code, all WooCommerce order notes will be deleted:

DELETE FROM wp_commentmeta WHERE comment_id IN ( SELECT ID FROM wp_comments WHERE comment_type = 'order_note' );
DELETE FROM wp_comments WHERE comment_type = 'order_note';

Tip: If the prefix for your WordPress tables was not wp_, you must replace it with your tables prefix in all the above codes.

For example, as you can see in the image below, the prefix of this site is “apos_”:

table prefic in sql tables
Woocommerce remove order notes

Therefore, to remove all orders at once from this site, the following code is entered in the SQL query:

delete all orders and notes from database using sql
Remove order notes woocommerce

Here is the code:

DELETE FROM wp_woocommerce_order_itemmeta;
DELETE FROM wp_woocommerce_order_items;
DELETE FROM wp_comments WHERE comment_type = 'order_note';
DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE post_type = 'shop_order' );
DELETE FROM wp_posts WHERE post_type = 'shop_order';

If you are not familiar with coding, it is better to use the following two methods to bulk delete orders.

2. Default WooCommerce bulk delete orders

Another method to delete bulk orders is using the WooCommerce default options. Although these options can make managing orders easier, they also have limitations. These limitations will convince you that installing the WooCommerce bulk orders edit pro plugin is the best way to manage orders.

WooCommerce order bulk edit

To bulk delete orders WooCommerce plugin, you must go through the following steps:

1. filtering WooCommerce orders based on status, user, and date

To woocommerce bulk delete orders, you must enter the WordPress dashboard and go to the following path:

WooCommerce > Orders

As shown in the image below, a table of all orders will be displayed to you. To bulk delete the orders using the default WooCommerce orders list, you can first filter them:

Filter orders based on status

As shown in the image below, you can see the order status at the top of the table. Just click on each status link to filter the orders based on status. For example, completed or pending payment.

select order statuses from woocommerce order list

Selecting the desired status, the filtered orders will be displayed in the table.

For example, if you select Completed, you will see all completed orders in the table.

To bulk delete these orders, click on the checkbox next to the orders column to select all orders, then delete them, as we explain at the end.

select all complete orders for bulk delete
Filter orders by date

You can also filter WooCommerce orders by date. At the top of the orders table, you will see a combo box related to the date.

filter orders by date in woocommerce

You will get a drop-down menu of orders based on month and year by clicking this box. Then you can click on a specific month. In the example above, the month of November 2021 is selected.

When you click on the Filter button, only the orders of the selected month will be displayed in the table, and you can perform bulk deletion by selecting them again.

Filter WooCommerce orders based on registered customers

Another way to filter orders in WooCommerce’s default options is the name of customers who have registered in your WooCommerce store.

You can type the customer’s name in the Filtered by registered customer field. Then click on the Filter button. After that, you can see all the orders registered by the desired customer in the table.

filter orders by username in woocommerce

2. Set the number of orders in the WooCommerce table

By default, WooCommerce lists 25 orders in the orders table, so you can delete only 25 orders by clicking the bulk delete option.

However, if orders exceed 25, you can go to Screen options and enter the desired number in the Number of items per page field. You can increase this number to 999; for example, if you enter 500, up to 500 orders will be displayed on one page of the WooCommerce orders table. You can select all of them and delete them in bulk.

select screen option and enter number items per page

3. Bulk delete orders woocommerce and move them to the trash

After selecting the orders, you want to bulk delete, select the Move to Trash option from the Bulk actions drop-down. Then click on the Apply button. 

Note: This will not permanently delete the orders but move them to the trash.

select move to trash in woocommerce orders

4. Remove orders WooCommerce from the trash permanently 

To permanently delete orders, go to Trash and select all the orders you want to delete. Finally, click on Delete Permanently from the drop-down menu.

Finally, click on the “Apply” button.

select delete permanent in orders woocommerce

You can also click on the Empty trash button to permanently delete all orders in the trash.

According to the explanations, you must have noticed that the bulk deletion of orders with WooCommerce default options has many limitations, including:

  • It is impossible to filter based on all order fields, such as product, shipping method, payment method, etc.
  • It is not possible to filter orders in combination. For example, you cannot filter orders for a specific product in a particular period.
  • Filtering and bulk delete processes are very long, and deleting selected orders takes a lot of time from the store manager.

If you also face these problems in bulk editing WooCommerce orders, we suggest you install the WooCommerce bulk edit orders plugin and use its great features to manage orders.

In the following, we will try to WooCommerce delete orders using this plugin.

3. Bulk delete orders WooCommerce using a plugin

Bulk deletion of orders is done very quickly and easily with the WooCommerce orders bulk edit plugin. In this plugin, various methods are considered for the bulk deletion of orders. So the site manager can delete the desired orders in bulk without any restrictions in less than a few minutes.

First method:

Bulk delete all WooCommerce with one click

If you want to delete all the orders on WooCommerce at once, click on the plugin’s trash button and select delete all. This quick and easy method moves all orders to trash with one click.

select trash and delete all in woocommerce order plugin
Woocommerce order plugin

Second method:

Filter WooCommerce orders, then bulk delete

Filtering and deleting orders is possible in the WooCommerce bulk orders edit plugin. A filter form is designed in this plugin that allows you to filter orders based on all the fields available in WooCommerce orders, including default fields and meta fields:

  • Order ID
  • Customer name
  • Billing Address
  • Product
  • Product category
  • Attributes
  • Shipping address
  • Order date
  • Status
  • So on

For example, as shown in the image below, to filter WooCommerce orders in a specific time frame and based on several specific statuses, enter the General tab in the filter form and proceed as follows:

  • In the Date field, we specify the desired period using the internal calendar designed for the plugin.
  • Select the options from the displayed list in the Status field.

You can use any other type of filter in combination with this form, and there is no limit for filtering WooCommerce orders in bulk orders edit pro plugin.

set date and status filter in woocommerce bulk order
Woocommerce remove all orders

After filtering the orders, click on the Get orders button, so that the orders are filtered according to your request and displayed in the table.

First, select all orders for bulk deletion by activating the check box next to the ID column.

Then click on the trash icon and choose one of the following options:

  • Move to trash: Selected orders are moved to trash.
  • Permanently: Selected orders are permanently deleted.
delete orders in woocommerce bulk order plugin
Delete all orders woocommerce

If you select the Move to trash option, you can delete orders permanently later. For this, you must go to Trash by selecting Status in the search bar. Then select deleted orders and delete them by choosing the permanent option.

select trashed order status
Delete all woocommerce orders

Restore deleted WooCommerce orders from history

Also, if you have a mistake in deleting the orders, you can enter the plugin History tab and restore the orders by clicking the Revert button.

select revert on history tab

Note: If you choose the permanent option, it is impossible to return the orders, and orders will be deleted from your site forever.

WooCommerce order bulk edit

third method:

Filter WooCommerce orders, then export

Another method to bulk delete WooCommerce orders in the bulk orders edit plugin is to export the orders data and edit them using Excel software. In this plugin, there is the ability to import/export orders in CSV format. Therefore, you can get a CSV output from them after filtering the orders, then delete the orders with Excel software from the downloaded file, and finally import the CSV file through the plugin.

export import woocommerce orders

Read the tutorial on how to import/export CSV files through the WooCommerce bulk orders edit pro plugin in the link below:

How to import/export orders with WooCommerce bulk orders edit pro plugin?

Benefits of WooCommerce bulk orders editing plugin

In addition to bulk delete orders woocommerce, the WooCommerce bulk orders editing plugin has many other features and functions that will help you to manage the orders more efficiently. It allows you to see a list of all orders in a table with editable columns displaying all the information you need, including order items (products), view order status, order amount, customer details, and billing or shipping details at one glance.

You can also use other benefits of this plugin to better manage WooCommerce orders, including:

Duplicate WooCommerce orders 

Duplicate orders in WooCommerce bulk orders editing plugin

If you need to copy several WooCommerce orders and want all order items such as product items, quantity, price, and customer information to be duplicated, you can easily use the Duplicate tool in the plugin toolbar. This tool will help you a lot, for example, if a customer orders the same products every time, you don’t need to insert the order information repeatedly, you can copy the same customer’s order several times with just one click and manage them, faster and easier. 

We have fully explained the step-by-step method of duplicating WooCommerce orders, in this guide.

Bulk edit orders in WooCommerce 

Bulk edit form in WooCommerce bulk orders editing plugin

In the WooCommerce bulk edit orders plugin, you have access to an advanced bulk edit form that supports all fields of WooCommerce orders. This form allows you to quickly edit any order field like product items, product number, order status, order date, order amount, billing or shipping information, customer email, etc. To make your work easier, WooCommerce fields are separated into six different tabs, and you can quickly find the fields you need to make changes.

Export WooCommerce orders 

Export form in WooCommerce bulk orders editing plugin

Another useful tool designed for WooCommerce store managers in this plugin is the import and expert form. This form allows you to export all the details of your WooCommerce orders as a CSV file or import them with a single click. Unlike the default WooCommerce editor, you must not export all orders with all relevant data, at once. Rather, you can first filter specific orders and then export some fields of selected orders that you need. 

Here you can read the step-by-step guide for the plugin’s import-export method.

Conclusion

Bulk delete orders from WooCommerce with the WooCommerce orders bulk edit plugin makes order management much easier. In addition to filtering and deleting orders, you can use this plugin as a helpful plugin for bulk editing all WooCommerce order fields.

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha loading...