For many WooCommerce store owners, manually changing order statuses from “Processing” to “Complete” can be a time-consuming task, especially when dealing with simple or virtual products that don’t require shipping. Automating this process can save time and ensure customers receive order updates more quickly. In this guide, we’ll show you how to automatically complete orders in WooCommerce once they reach the “Processing” stage, using a simple addition to your theme’s functions.php file.
Before implementing this customization, it’s advisable to use a child theme to avoid losing your changes when your main theme updates. You can create a child theme quickly using our free WordPress child theme generator.
Step 1: Add Custom Code to Automatically Complete Orders
You can automatically mark orders as “Complete” by adding a function to your theme’s functions.php file that hooks into the WooCommerce order status transition. This function will check if the order contains only downloadable or virtual products and, if so, will change the order status to “Complete.” Here’s how you can add this functionality:
/*
* Snippet: How to Automatically Complete Processing Orders in WooCommerce – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1476
* Tested with WooCommerce 10.7.0
* "Automatically mark orders as complete if they only contain downloadable or virtual products"
*/
function wc_success_auto_complete_order($order_id) {
if (!$order_id) {
return;
}
$order = wc_get_order($order_id);
$items = $order->get_items();
foreach ($items as $item) {
$product = $item->get_product();
if (!$product->is_virtual() && !$product->is_downloadable()) {
return; // Don't complete the order automatically if any product is not virtual or downloadable
}
}
// If all products are virtual or downloadable, mark the order as completed
$order->update_status('completed');
}
add_action('woocommerce_order_status_processing', 'wc_success_auto_complete_order');
This code snippet checks each product in an order when its status transitions to “Processing.” If all products are either virtual or downloadable (i.e., do not require shipping), the order status is automatically updated to “Complete.”
Step 2: Testing Your Code
After implementing the code, it’s crucial to test it to ensure it behaves as expected. Create test orders with different combinations of products (virtual/downloadable and physical) to verify that the automation works correctly:
- Place an order with only downloadable or virtual products.
- Place another order that includes at least one physical product.
The first order should automatically switch to “Complete,” while the second should remain in “Processing” until manually updated, assuming other conditions like payment confirmation are met.
Conclusion
By automating the completion of certain orders, you streamline your operations, reduce administrative overhead, and improve customer satisfaction by providing faster updates. This approach is especially beneficial for stores that primarily sell virtual or downloadable products.
If you haven’t yet set up a child theme, using our free WordPress child theme generator can help you make these changes safely and easily.
Implementing this feature allows you to focus more on growing your business and less on routine administrative tasks, enhancing both efficiency and customer experience in your WooCommerce store.
I have been working with WordPress and WooCommerce since 2012 and have developed a deep knowledge of the content management system. Since 2012, I have developed several plugins and designed dozens of websites utilising different frameworks, CMS’s and programming languages. I am proficient in PHP, Python, Java, C, C++, R and JavaScript with limited experience in Go, Kotlin and Swift.
Educationally, I have a Master’s degree in cyber security a Bachelor’s (Hons, First Class) in Applied Research and a Graduate Certificate in Data Science. I’m currently undertaking PhD studies investigating IoT cybersecurity. I recently graduated with First Class Honours and Masters of Information Technology, receiving the Executive Dean’s Award for studies undertaken in the 2021 and 2022 academic years. I have worked in the information technology industry for the past 11 years primarily as a software/web developer specific to design, optimisation, network management and security. My research interests are in the areas of Internet of Things (IoT), 5G and Beyond Networks, information security for wireless networks and software development.
Stay In Touch

