Sometimes we need to add new attributes to a Magento store. Sometimes that store is new and hasn’t been populated, sometimes it’s got 20,000 products in it. I recently wrote an article about Attribute Mapping with Google Content in Magento and this is a prime example. We needed to add a new attribute “Google Title” which included the brand name (and then map it to Google Content).

So, how can we do this?

The easiest way would be to create the new attribute and then assign it to the attribute set for your products. We can then get a list of all the products, cycle through them and add this new value.

With this code, we’d have an attribute called google_title. We could use the same base code to quickly update existing Magento information (such as name, description etc)

Image Credit: wili_hybrid