WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Clipper, a coupon theme developed by AppThemes.com, and I'm trying to programmatically import coupons.

The problem I'm having is each coupon needs to have a "store" added when it's uploaded.

I can add the "store name" just fine, but I'm not able to update one of the custom fields associated with the "stores" taxonomy.

Below is my code to update the custom_field. 41 is the term_id of the taxonomy I'm trying to update.

wp_update_term( 41, 'stores', 
'clpr_store_url' => $url,
'clpr_store_aff_url' => $url

It appears that "wp_update_term" does not allow me to update the field "clpr_store_url".

Here is the documentation for the function but it doesn't help me out:


share|improve this question

Assuming this

  • store is custom post type.
  • stores is category
  • clpr_store_url a custom field for store which is custom post type

The function wp_update_term() can only be used for updating information about a term itself, here in this case you can update info. such as name, slug etc. of a category - stores (See Notes for all allowed tags)

So to update custom field value you should use function - update_post_meta()

$post_id =  $post->ID;
$meta_key = 'clpr_store_url';
$meta_value = $url;
$prev_value = $old_url;
update_post_meta($post_id, $meta_key, $meta_value, $prev_value);
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.