<?php
ini_set(‘memory_limit’, ‘2048M’);
ini_set(‘max_execution_time’, 180000);
require_once ‘../app/Mage.php’;
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

Mage::init();
//echo “TTT”;
$app = Mage::app(‘default’);
Mage::register(‘isSecureArea’, 1);
$row = 0;

if (($handle = fopen(“delete.csv”, “r”)) !== FALSE) {
while (($data = fgetcsv($handle, 1000, “,”)) !== FALSE) {
echo ‘Importing product: ‘.$data[0].'<br />’;
foreach($data as $d)
{
echo $d.'<br />’;
}
$row++;
if($row == 1) continue; // first column ignoring of CSV
$_catalog = Mage::getModel(‘catalog/product’);
$_productId = $_catalog->getIdBySku($data[0]); // CSV column $data[0] for SKU, From CSV getting Product ID
$product = Mage::getModel(‘catalog/product’)->load($_productId);
$product->delete();

// Test purpose is it working or not.
//if($row == 2) exit();
}
fclose($handle);

}else{
echo “LLLLLLLLLLLLLLL”;
}

?>