In this tutorial, we’ll show you how to delete customers after X days without purchases. We always have some customer profiles who have been registered for some months and have not registered any purchase yet. And these are useless profiles occupying some space in our database.
We’ll show you how to quickly find and delete them. And we won’t use any snippet nor will we check user profiles one by one. Instead, we’ll use the WooCommerce Customers Spreadsheet plugin.
It displays all our customers in a spreadsheet where we can do advanced searches and apply bulk changes in seconds. With this plugin, you don’t have to worry about spending a lot of time editing your customer profiles because you have all the benefits of spreadsheets to help you save lots of hours and clicks.
Once installed and activated, just follow these steps to delete your customers how were registered some time ago and haven’t purchased anything.
1- Open the WooCommerce customers spreadsheet
To view all the WooCommerce customer profiles displayed in the spreadsheet, go to WP Sheet Editor > Edit Users. All the WordPress users will be displayed as rows and their complete fields will be displayed as columns.
2- Search for all the users you’ll delete
To search for all the customers without purchases for the past three months, for example, you need to open the Search tool with one click on the toolbar.
Once there, you need to select these values to search for all the customers without purchases for a certain period of time:
- Role: Customer
Tick the Enable advanced filters checkbox and select these values:
- Field: Registration date
- Operator: We’re on May 11, 2020. And we want to select all customers registered on February 01, 2020 and before, so we need to select <=.
- Value: Enter the date following the YYYY-MM-DD format. In this example, we’ll enter this date: 2020-02-01.
Click Add New to create a new advanced filter and select these values:
- Field: Orders count
- Operator: =
- Value: 0
Finally, click Run Search to filter all the search results without purchases since the selected date. They will be displayed in the spreadsheet. You’ll see the filters you applied.
3- Delete all the filtered customer profiles
After filtering all the customers without purchase for a certain time, they will be displayed in the spreadsheet. You need to open the Bulk Edit tool with one click on the toolbar.
Once you open the Bulk Edit tool, select these values to delete all the filltered customer profiles at once.
- Select the rows that you want to update: Edit all the rows from my current search (including non-visible rows)
- What field do you want to edit: Status
- Select type of edit: Set value
- Replace existing value with this value: Delete
- Click Execute Now to apply these values.
After applying these values, all the customers registered on the selected date and before will be deleted from your database.
That’s how simple it is to filter and delete all customers after X days without purchases. You don’t have to open them one by one; instead, you can quickly filter and delete them all at once!