In the backend admin panel of Magento I'm reading 3026 products, all of which function perfectly, I did a lot of importing using a custom made script in the beginning, and I'm afraid it must have left some orphaned entries in the database somewhere, when loading the product model and calling getCollection(), and then count, I'm showing ~7800 products. Also when I run the exporter, it verifies this and I have thousands of blank rows with store/website filled in and nothing else.
Any ideas how to clean this up?
TL;DR - Alan Storm, plz halp.
Edit: On second thought, I suppose I could just load all products and find all with an empty product name and call delete on them, and that should take care of any orphaned entries?
Best is you do this the "magento way" something like this:
require_once MAGENTO . '/app/Mage.php';
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$products = Mage::getModel('catalog/product')
->getCollection(); // here you could filter out already like ->addFieldToFilter("name","");
foreach($products as $product){
if(empty($product->getName())
$product->delete();
}