added 14 characters in body
Source Link
delete the products against skus

   ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('memory_limit', '-1');
ini_set('max_execution_time', 0); 
set_time_limit(0);
error_reporting(E_ALL);
require __DIR__ . '/app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

$objectManager = $bootstrap->getObjectManager();

$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('adminhtml');

$skuAll =array();
$file_handle = fopen("skus.csv", "r");
$header=fgetcsv($file_handle);
$product=$objectManager->create('Magento\Catalog\Model\Product');
//$row=1;
 while ($row = fgetcsv($file_handle, 40000, ",") ) {
    // $data_count = count($row);
    // if ($data_count < 1) {
    //     continue;
    // }
    $data =array();
    $data = array_combine($header, $row);
    // $$data['sku'] = 'abc';
    $allSku = $data['sku']; 
    // echo $allSku;
    $loadProducts=$product->loadByAttribute('sku', $allSku);
     try {
          $loadProducts->load($allSku)->delete();
          echo "Product with Sku: " . $loadProducts->getSku() . " Deleted Successfully". PHP_EOL;
     } catch (Exception $e) {
          echo "Product with SKU: " . $loadProducts->getSku() . " cannot be deleted" . PHP_EOL;
     }
}
delete the products 
   ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('memory_limit', '-1');
ini_set('max_execution_time', 0); 
set_time_limit(0);
error_reporting(E_ALL);
require __DIR__ . '/app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

$objectManager = $bootstrap->getObjectManager();

$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('adminhtml');

$skuAll =array();
$file_handle = fopen("skus.csv", "r");
$header=fgetcsv($file_handle);
$product=$objectManager->create('Magento\Catalog\Model\Product');
//$row=1;
 while ($row = fgetcsv($file_handle, 40000, ",") ) {
    // $data_count = count($row);
    // if ($data_count < 1) {
    //     continue;
    // }
    $data =array();
    $data = array_combine($header, $row);
    // $$data['sku'] = 'abc';
    $allSku = $data['sku']; 
    // echo $allSku;
    $loadProducts=$product->loadByAttribute('sku', $allSku);
     try {
          $loadProducts->load($allSku)->delete();
          echo "Product with Sku: " . $loadProducts->getSku() . " Deleted Successfully". PHP_EOL;
     } catch (Exception $e) {
          echo "Product with SKU: " . $loadProducts->getSku() . " cannot be deleted" . PHP_EOL;
     }
}
delete the products against skus

   ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('memory_limit', '-1');
ini_set('max_execution_time', 0); 
set_time_limit(0);
error_reporting(E_ALL);
require __DIR__ . '/app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

$objectManager = $bootstrap->getObjectManager();

$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('adminhtml');

$skuAll =array();
$file_handle = fopen("skus.csv", "r");
$header=fgetcsv($file_handle);
$product=$objectManager->create('Magento\Catalog\Model\Product');
//$row=1;
 while ($row = fgetcsv($file_handle, 40000, ",") ) {
    // $data_count = count($row);
    // if ($data_count < 1) {
    //     continue;
    // }
    $data =array();
    $data = array_combine($header, $row);
    // $$data['sku'] = 'abc';
    $allSku = $data['sku']; 
    // echo $allSku;
    $loadProducts=$product->loadByAttribute('sku', $allSku);
     try {
          $loadProducts->load($allSku)->delete();
          echo "Product with Sku: " . $loadProducts->getSku() . " Deleted Successfully". PHP_EOL;
     } catch (Exception $e) {
          echo "Product with SKU: " . $loadProducts->getSku() . " cannot be deleted" . PHP_EOL;
     }
}
Source Link

delete the products 
   ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('memory_limit', '-1');
ini_set('max_execution_time', 0); 
set_time_limit(0);
error_reporting(E_ALL);
require __DIR__ . '/app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

$objectManager = $bootstrap->getObjectManager();

$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('adminhtml');

$skuAll =array();
$file_handle = fopen("skus.csv", "r");
$header=fgetcsv($file_handle);
$product=$objectManager->create('Magento\Catalog\Model\Product');
//$row=1;
 while ($row = fgetcsv($file_handle, 40000, ",") ) {
    // $data_count = count($row);
    // if ($data_count < 1) {
    //     continue;
    // }
    $data =array();
    $data = array_combine($header, $row);
    // $$data['sku'] = 'abc';
    $allSku = $data['sku']; 
    // echo $allSku;
    $loadProducts=$product->loadByAttribute('sku', $allSku);
     try {
          $loadProducts->load($allSku)->delete();
          echo "Product with Sku: " . $loadProducts->getSku() . " Deleted Successfully". PHP_EOL;
     } catch (Exception $e) {
          echo "Product with SKU: " . $loadProducts->getSku() . " cannot be deleted" . PHP_EOL;
     }
}