How do I delete orders in Magento 2.2.1? I deleted the orders in database from the sales_order table, but they still show in admin > sales > orders.
I don't want to use an extension. HELP!!!
Solved! Go to Solution.
Admin grid loads from sales_order_grid table. When a order is placed it is added in sales_order table and after indexing it is sent to sales_order_grid to be shown in backend list.
Hope this will help you.
Hi @Sheba,
Did you tried running the indexer from shell?
I was able to fix a similar issue with Customers grid but I'm not sure if Sales grid can be reindexed.
How did you delet the orders?
php bin/magento indexer:reindex
This is the shell command to run indexer in magento 2.
Order is still showing because those order entries are still exist in - sales_order_grid table.
Kindly delete all the data from sales_order_grid table.
After that run php bin/magento indexer:reindex command
It will works !!
Whenever you deleted the record from sales_order table at that time, Your order deletes from Magento but when you have checked inside order grid, you show those order because sales_order_grid table is responsible for Order Grid record in Magento 2 so you need to remove the record from sales_order_grid table also.
Below is a free extension for order delete in Magento 2,
After delete order, you need to run command for indexing,
php bin/magento indexer:reindex
You are the MAN!!! That WORKED!
Here are 2 more issues:
For those who might be interested there is one more way to delete orders in Magento 2 without a database. It is Magento 2 Better Order Grid, that allows you to delete orders from Magento 2 admin panel: from the order grid and order editing page.
And a lot more features like:
@Sheba, try to disable Asynchronous indexing under below configuration. Then grid get refreshed at same time when any order placed or deleted from Magento.
Configuration Path : Store > Configuration > Advance > Developer > Grid Settings