Gist for deleting orders from magento
<?php
require_once 'app/Mage.php';
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
umask(0);
Mage::app();
Mage::register('isSecureArea', 1);
$ordersToDelete = [
'100000268',
'100000267',
'100000266',
'100000265',
'100000264',
'100000263',
'100000262',
'100000261',
'100000260',
'100000259',
'100000255',
'100000253',
'100000252',
'100000251',
'100000250',
'100000249',
'100000248',
'100000247',
'100000246',
];
foreach ($ordersToDelete as $incrementId) {
$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
if ($order && $order->getId()) {
$invoices = $order->getInvoiceCollection();
foreach ($invoices as $invoice) {
$invoice->delete();
}
$creditnotes = $order->getCreditmemosCollection();
foreach ($creditnotes as $creditnote) {
$creditnote->delete();
}
$shipments = $order->getShipmentsCollection();
foreach ($shipments as $shipment) {
$shipment->delete();
}
$order->delete();
echo 'Order: ' . $incrementId . ' deleted succefully<hr>';
}
}