How to remove only group price from all products?

How to remove only group price from all products?

September 8, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to remove only group price from all products?

Removing Group Prices from All Products in Magento

Managing product prices in Magento can be complex due to its advanced pricing system that allows for tiered and group-specific pricing. If you want to remove only the group prices (and not other types of special prices) from all products, follow these steps:

Understanding Magento’s Price System

Magento uses various price tiers:

  • Regular Price: The default base price.
  • Special Price: A temporary discounted price with an end date.
  • Tier Price: Discounted prices for different quantity breaks.
  • Group Price: Discounted prices for specific customer groups.

The group prices are stored in the catalog_product_entity_tier_price table. Each row represents a tier price for a product, including the customer group ID and the price amount.

Step-by-Step Approach to Remove Group Prices

  1. Create a script: To perform bulk operations on all products, you can create a custom PHP script using Magento’s API. You need to have access to the server where your Magento installation is hosted.

  2. Load the required model: In your script, load the Mage_Catalog_Model_Product model and the Mage_Core_Model_Mysql4_Abstract class for database operations:

require_once 'app/Mage.php';
Umbrella::app()->setCurrentStore(Mage::getModel('core/store')->load(1)); // Set your store ID here

$productModel = Mage::getModel('catalog/product');
$dbResource = Mage::getSingleton('core/resource');
  1. Fetch all products: Use the getCollection() method to fetch all enabled products:
$products = $productModel->getCollection()
    ->addAttributeToSelect('entity_id')
    ->addFieldToFilter('status', 1); // Status 1 means 'Enabled'
  1. Remove group prices: Iterate through the product collection and delete only the rows where the customer_group_id is set:
foreach ($products as $product) {
    $productId = $product->getEntityId();

    // Fetch existing tier prices for the product
    $tierPrices = Mage::getModel('catalog/product_tier_price')->getCollection()
        ->addFieldToFilter('entity_id', $productId);

    foreach ($tierPrices as $tierPrice) {
        if (!empty($tierPrice->getCustomerGroupId())) { // Group prices have a non-zero customer group ID
            $resource = Mage::getSingleton('core/resource');
            $writeConnection = $resource->getConnection('core_write');

            // Delete the row from the database
            $writeConnection->delete(
                $resource->getTableName('catalog_product_entity_tier_price'),
                array(
                    'entity_id = ?' => $productId,
                    'customer_group_id != ?' => 0, // Exclude regular prices (group ID = 0)
                )
            );
        }
    }
}
  1. Run the script: Save this code in a PHP file and upload it to your Magento installation’s root directory via FTP or SFTP. Run the script by accessing its URL in your browser.

Conclusion

Removing group prices from all products in Magento requires careful handling of the database, as you need to differentiate between regular prices and tiered (group) prices. By following this approach, you can efficiently delete only the group-specific price rows while preserving other pricing data for each product.

Remember that modifying your store’s database directly should always be done with caution. Always backup your data before performing any bulk operations like these. If you’re unsure about the process or need further assistance, consider reaching out to a Magento consultant from Laravel Company for professional support.

Happy coding!

Catalog Database API Customers

Our network