How to remove Magento custom order status

How to remove Magento custom order status

July 16, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to remove Magento custom order status

Removing Magento Custom Order Status: A Developer’s Guide

So you’ve added a custom order status in your Magento Admin Panel but now need to remove it? Don’t worry—we’ll guide you through the process without having to delve into the database directly.

Understanding Magento’s Order Status System

Before we proceed, let’s briefly understand how Magento handles order statuses. By default, Magento includes standard order statuses like “pending”, “processing”, and “complete”. However, it allows for extension developers to add new statuses easily using the sales_order_status database table.

The Challenge: No Direct Removal Option

You might have noticed that there isn’t a direct removal option in the Admin Panel for custom order statuses you’ve created. This is because Magento doesn’t provide an out-of-the-box feature for deleting statuses after they’re added.

The Solution: Using Magento’s Core APIs and Best Practices

To solve this, we’ll leverage Magento’s core APIs along with some best practices to delete the custom order status safely and efficiently.

Step 1: Disable the Order Status

First, let’s disable the order status in the Admin Panel. This won’t actually delete it but will prevent any new orders from being assigned that status:

  1. Log in to your Magento Admin Panel.
  2. Navigate to “Sales” > “Order Status”.
  3. Find the custom order status you want to remove.
  4. Click on “Edit”.
  5. Set “Is Active” to “No”.
  6. Save the changes.

Step 2: Delete the Order Status (Caution Required)

Now, we’ll delete the order status using Magento’s core APIs. This step involves directly interacting with the database, so proceed with caution and ensure you have a backup of your data first.

Using Magento’s API

You can use the salesOrderStatusRepository to delete the order status programmatically:

$status = $this->getSalesOrderStatusRepository()->create();
$status->setStatusCode('custom_status_code'); // Replace with your custom code
$this->getSalesOrderStatusRepository()->delete($status);

Remember to replace 'custom_status_code' with the actual code of the status you want to delete.

Direct SQL Query (Avoid if Possible)

If you prefer a more direct approach, you can use the following SQL query:

DELETE FROM sales_order_status WHERE status = 'custom_status_code';

Again, be extremely cautious when running raw SQL queries directly on your production database. Ensure you have a backup and understand what you’re deleting.

The Importance of Proper Magento Development

Removing order statuses should ideally happen during the initial setup or extension development process. It’s good practice to use Magento’s core APIs for such tasks rather than relying on direct DB manipulation.

For more advanced customizations, consider using LaravelCompany’s expertise in Magento development. Our team specializes in creating efficient and secure solutions tailored to your business needs.

Conclusion: A Clean Slate

By following these steps, you’ve successfully removed the custom order status from your Magento installation without having to view or modify the database directly. Always remember:

  • Before any major changes, back up your data.
  • Use Magento’s core APIs where possible for safety and consistency.
  • For complex tasks, consult with a professional development team like LaravelCompany to ensure optimal performance and security.

Happy coding!

Database API Extensions Admin

Our network