Auto-Filling Product SEO Data (Meta Tags, Descriptions) in 1C-Bitrix
Empty <title> and <meta name="description"> tags on 20,000 product pages directly damage organic traffic. Manual population is not realistic; template-based generation ("Buy {NAME} at the best price") works, but only moderately well. A properly implemented automation produces unique meta tags based on real product data — without duplication and accounting for the specifics of each category.
How 1C-Bitrix Stores SEO Data
SEO fields for info block elements are stored in the b_iblock_element_iprop table (SEO templates) and in direct fields:
-
b_iblock_element.NAME— used as a fallback for the title -
b_iblock_element_property— properties of type SEO_TITLE, SEO_DESCRIPTION (if created manually)
1C-Bitrix provides the \Bitrix\Iblock\InheritedProperty\ElementValues class for working with SEO fields via the template mechanism. This is the preferred approach — it handles inheritance from the section and info block.
Writing SEO data via the API:
$ipropValues = new \Bitrix\Iblock\InheritedProperty\ElementValues($iblockId, $elementId);
$ipropValues->save([
'ELEMENT_META_TITLE' => $metaTitle,
'ELEMENT_META_DESCRIPTION' => $metaDescription,
'ELEMENT_META_KEYWORDS' => $keywords,
'ELEMENT_PAGE_TITLE' => $pageTitle,
]);
Template-Based Generation with Variables
The basic approach: templates with placeholders, unique per category.
Example templates by category:
-
Electronics:
{NAME} — buy for {PRICE} | {BRAND} authorized dealer -
Clothing:
{NAME} {COLOR} {SIZE} — buy online -
Spare parts:
{NAME} art. {ARTICLE} — {QTY} in stock, price {PRICE}
Templates are stored in a SeoTemplates Highload block linked to IBLOCK_SECTION_ID. At generation time: find the nearest section with a template (walking up the tree), replace placeholders with element property values.
Constraints: title up to 70 characters, description up to 155–160. After substitution — truncate intelligently: do not cut a word in the middle, append "..." if the text was trimmed.
AI Generation for Uniqueness
Template meta tags share the same structure — search engines notice this. For important categories or highly competitive queries — generate via LLM:
$prompt = "Write an SEO title (up to 65 characters) and meta description (up to 155 characters)
for the product: {$product['NAME']}, brand: {$product['BRAND']},
attributes: {$characteristicsText}.
Response format: JSON {\"title\": \"...\", \"description\": \"...\"}";
$response = $openAiClient->chat($prompt);
$seoData = json_decode($response, true);
Cost: approximately $0.001–0.003 per product on GPT-3.5-turbo. For 10,000 products — $10–30.
Priorities and Protecting Manual Edits
SEO data often requires manual refinement for top-performing positions. Priority logic:
- If
ELEMENT_META_TITLEwas filled manually (flagSEO_LOCKED = Y) — leave it untouched - If empty — generate from template
- If template generation is weak (low quality by length/uniqueness metrics) — queue for AI generation
Auto-Update on Product Change
Meta tags should be updated when the name, price, or stock level changes. The OnAfterIBlockElementUpdate event handler:
AddEventHandler('iblock', 'OnAfterIBlockElementUpdate', function($fields) {
if (in_array($fields['IBLOCK_ID'], $catalogIblockIds)) {
SeoAutoFillQueue::add($fields['ID'], 'update');
}
});
Do not update synchronously in the handler — add to the queue and let a worker process it asynchronously.
Project Timeline
| Phase | Duration |
|---|---|
| Audit of current SEO fields, identifying gaps | 2–4 hours |
| Category template system | 1–2 days |
| 1C-Bitrix InheritedProperty API integration | 4–8 hours |
| AI generation for priority categories | 1–2 days |
| Manual edit protection, update triggers | 1 day |
| Admin interface for template management | 1 day |
Total: 5–8 working days. Results become visible in organic search 4–8 weeks after indexing.







