Title: Programatically adding variation attributes?
Last modified: September 1, 2016

---

# Programatically adding variation attributes?

 *  Resolved [davedog33](https://wordpress.org/support/users/davedog33/)
 * (@davedog33)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/programatically-adding-variation-attributes/)
 * I can’t find any metadata attached to a variation post. Are they tied to the 
   variation by setting a taxonomy term? I tried that and it didn’t seem to work
   either:
 * wp_set_object_terms($wcVariationId, $attributeTerm, ‘pa_size’, true );
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/programatically-adding-variation-attributes/#post-7529145)
 * The variable product (parent) is assigned the terms.
 * The variation is assigned meta only.
 * Create a variation manually to see the schema.
 * Remember you can use the REST API as well to mod data without PHP code [https://woothemes.github.io/woocommerce-rest-api-docs/](https://woothemes.github.io/woocommerce-rest-api-docs/)
 *  Thread Starter [davedog33](https://wordpress.org/support/users/davedog33/)
 * (@davedog33)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/programatically-adding-variation-attributes/#post-7529284)
 * Thanks. Couldn’t find any metadata cause I was looking in variations that didn’t
   have any assigned terms. Ugh :P. I assumed that it would have shown an empty 
   array in the metadata, but I guess not!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Programatically adding variation attributes?’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [davedog33](https://wordpress.org/support/users/davedog33/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/programatically-adding-variation-attributes/#post-7529284)
 * Status: resolved