Powered by Blogger.

Replace URL/content in a WordPress database table


Replace URL/content in a WordPress database table

Please take back-up of your current database before running query
update wp_posts set post_content = replace(post_content, 'http://localhost/dpsi', 'client.ocularconcepts.us/developement/dpsi');
You can change the table name ‘post_content’ if you want to replace any other table
for eg. you want to replace URL from guid field of table wp_posts than query will be
update wp_posts set guid = replace(guid, 'http://localhost/dpsi', 'http://client.ocularconcepts.us/developement/dpsi');
Run this query in phpmyadmin, select the table before run query

Query syntax: Find & Replace Data in MySQL

update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_

No comments