vendredi 2 janvier 2015

Search and Replace Custom Field value in PHPMyAdmin


I'm not sure if this is more of a MySQL question than a WordPress question but I thought it best to post it here.


I would like to search through all the values of a custom field called "offer_price". I would like to search these fields for any spaces and remove them. There are actually thousands of these values so doing it manually is out of the question. I belive I can do this using PHPMyAdmin. I don't know very much about MySQL but doing some research it seems that I can do this using something like the following:



UPDATE wp_postmeta SET meta_value = replace(meta_value, ' ', '') WHERE meta_key = "offer_price";


Can someone advise if this is along the correct lines? Also where in PHPMyAdmin would I enter this?





Aucun commentaire:

Enregistrer un commentaire