Bulk Product Editing Setup in 1C-Bitrix
Catalog has 5000 products, 800 need one field updated — say, add "bestseller" flag. Editing one by one is a work day. Standard bulk editing in Bitrix admin covers most scenarios but has limitations you need to know.
Standard Bulk Editing Mechanism
In product list admin (/bitrix/admin/iblock_list_admin.php?type=catalog) select needed positions, then "Edit selected" action. Form opens where only changed fields specified — others remain unchanged.
Technically works via CIBlockElement::Update() called for each selected ID. Parameter $bWorkFlow = false — no draft creation. On property update, Bitrix rewrites only passed properties, not touching others.
Standard mechanism limitation: doesn't work with multiple properties (type L with multiple values) and doesn't support conditional update ("set value only if current empty").
Bulk Update via API
For updating many products via script correctly use D7 API with batch processing:
$productIds = [1001, 1002, 1003, /* ... */];
$batchSize = 50;
$chunks = array_chunk($productIds, $batchSize);
foreach ($chunks as $chunk) {
foreach ($chunk as $id) {
\CIBlockElement::Update($id, false, [
'PROPERTY_VALUES' => [
'IS_HIT' => 'Y',
],
]);
}
// Small delay between batches to not overload MySQL
usleep(100000); // 100ms
}
For purely table data (b_catalog_product fields, not infoblock properties) direct update faster via D7:
\Bitrix\Catalog\ProductTable::updateMulti($productIds, [
'VAT_ID' => 3,
'VAT_INCLUDED' => 'Y',
]);
Method updateMulti executes single SQL UPDATE with WHERE ID IN (...) instead of N separate queries.
Property Update with Indexing
On bulk property update Bitrix by default reindexes for each element — calls CSearch::Index(). Updating 1000 products creates 1000 inserts in b_search_content.
Disable reindexing on bulk update:
define('BX_SKIP_SEARCH_REINDEX', true);
// ... bulk update ...
// After — run reindexing with single agent
\Bitrix\Main\Config\Option::set('search', 'reindex_pending', 'Y');
After bulk update completion, agent CSearchReindex::AgentReindex() batch rebuilds index.
Changed Fields in Single Transaction
Updating multiple fields of one product should go in single Update() call, not multiple sequential calls. Each CIBlockElement::Update() call triggers events, updates cache, creates change log entry (if iblock.workflow module enabled). Extra calls increase operation time proportionally.
Progress Monitoring
On bulk update via web interface Bitrix uses "continuation" mechanism via sessid parameter and hidden fields — every N elements page reloads with progress. For script processing more convenient to write progress to file and read via AJAX:
file_put_contents('/tmp/update_progress.json', json_encode([
'processed' => $processed,
'total' => $total,
'percent' => round($processed / $total * 100),
]));
When bulk updating "list" type (L) properties, first get ID of list value from b_iblock_property_enum — must pass ID, not text value.







