blog
{Some Little News}
VR
{Virtual Reality}
media
{Photos + Videos}
code
{Websites + Apps}
5core
{Five Core}
Batch replace string in wordpress table
Today I needed to replace LOTS of values inside a wordpress database, especially the meta_value in the wp_postmeta table. This solution will allow you to only replace values with a specified meta_key. It is very usefoul if you are using (like me) some “custom values” plugin in your posts.
UPDATE `YOUR_WORDPRESS_DATABASE`.`wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,"OLD_STRING","NEW_STRING") WHERE `wp_postmeta`.`meta_key` = "YOUR_META_KEY";
This solution is also much better than downloading the database and using a text editor because you can specify the meta_key to be selected!







Pingback: Tweets that mention Batch replace string in wordpress table | Some Little News -- Topsy.com
Pingback: Blog