Editing contents of meta data for a big product base, can be very time consuming. But You can always use SQL…
1. Get atributte_id
for meta data:
1 2 3 |
SELECT attribute_id,attribute_code FROM `eav_attribute` WHERE `attribute_code` LIKE '%meta%' |
The result should be similiar to:
1 2 3 4 5 6 7 8 9 10 |
+--------------+------------------+--------------+ | attribute_id | attribute_code | backend_type | +--------------+------------------+--------------+ | 40 | meta_title | varchar | | 41 | meta_keywords | text | | 42 | meta_description | text | | 76 | meta_title | varchar | | 77 | meta_keyword | text | | 78 | meta_description | varchar | +--------------+------------------+--------------+ |
We’ll use the attribute_id in the next query. The backend_type determines in which table the data is kept. For example it’d be catalog_product_entity_varchar
for an attribute with varchar backend_type
.
2. Replace desired content with queries
1 2 3 4 5 6 7 8 9 10 11 12 13 |
UPDATE `catalog_product_entity_varchar` SET `value` = REPLACE(value,' EXAMPLE ',' EXAMPLE2 ') WHERE `value` LIKE '% EXAMPLE %' AND (attribute_id =40 OR attribute_id =76) -- -- OR -- UPDATE `catalog_product_entity_text` SET `value` = REPLACE(value,' EXAMPLE ',' EXAMPLE2 ') WHERE `value` LIKE '% EXAMPLE %' AND (attribute_id =42 OR attribute_id =78) |
Comments Off on Magento change product meta data by SQL Queries