Skip to main content

Bulk Replacing Strings in phpMyAdmin

·55 words
icysamon
Author
icysamon
I really love making things by hand and turning my ideas into reality.

Query
#

UPDATE <'table'> SET <'column'> = REPLACE(<'column'>, <'string to replace'>, <'replacement string'>);

For example, in my case:

UPDATE wp_2_posts SET post_content = REPLACE(post_content, 'www.cdn', 'cdn');

What Is a Table?
#

Elements like wp_posts within a database structure are called tables.

What Is a Column?
#

Elements like post_content within a table are called columns.