Solved

Bulk "Find & Replace" Text in MySQL

Posted on 2011-03-15
2
415 Views
Last Modified: 2012-05-11
Hi,

In my Wordpress blog I have a picture in all my posts. I want to change it's current height from 500 to 400 so I want to replace in my MySQL database the text (height="500" with height="400")

WP Posts table in MySQL is : wp_posts
MySQL field where the text I want to replace is : post_content

Please let me know how I can do that.


Thanks for your help.
0
Comment
Question by:Dido123
2 Comments
 
LVL 8

Accepted Solution

by:
Rik-Legger earned 500 total points
ID: 35143522
This will do:

update wp_posts set post_content = replace(post_content,'height="500"','height="400"');

Open in new window

0
 

Author Closing Comment

by:Dido123
ID: 35144434
Thank you so much. It worked!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating and Managing Databases with phpMyAdmin in cPanel.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
The viewer will learn how to count occurrences of each item in an array.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question