Mass Description Change in Magento 1.9, 1.8, and 1.7

databasemagento-1.7magento-1.8magento-1.9

I need to remove certain part of description from ~200 products.
How should i do it?
I cant do it directly from admin panel.
I thought about exporting all of my products to csv file, modify it and then import it back again.
Is there another way to do that? Something that involves PHP or accessing database?

Best Answer

The fastest way is probably to use a database query. If you want to write a script to do it, you could just put a php script in your root and run it from the command line. It would look something like this:

<?php
require_once('app/Mage.php');
Mage::app('default');
$collection = Mage::getModel('catalog/product')
    ->getCollection()
    //->addFieldToFilter('') //Use filters to select a specific group of products
    ->addAttributeToSelect('description');

foreach($collection as $product) {
    $desc = $product->getDescription();
    // Remove parts of your description here
}
Related Topic