Title: Updating custom field values using the SQL database
Last modified: August 19, 2016

---

# Updating custom field values using the SQL database

 *  Resolved [eddywebs](https://wordpress.org/support/users/eddywebs/)
 * (@eddywebs)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/updating-custom-field-values-using-the-sql-database/)
 * Hi , I am trying to come up with a SQL query to update a custom field value of
   all the wordpress post at once.
 * The custom field is **“price”** : and I am trying to update all the values by
   20% (that is .20*price) .
 * I know all the custom fields are stored at wp_postmeta table but dont know where
   to go from there.
    Any suggestions ???

Viewing 1 replies (of 1 total)

 *  Thread Starter [eddywebs](https://wordpress.org/support/users/eddywebs/)
 * (@eddywebs)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/updating-custom-field-values-using-the-sql-database/#post-1425823)
 * got it the query would be Update wp_postmeta set meta_value = (meta_value * .
   20) where meta_key = ‘price’;

Viewing 1 replies (of 1 total)

The topic ‘Updating custom field values using the SQL database’ is closed to new
replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [eddywebs](https://wordpress.org/support/users/eddywebs/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/updating-custom-field-values-using-the-sql-database/#post-1425823)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
