How to Find and Replace Text in your WordPress Database

Search_and_Replace_wordpress_database

There are times when you have a blog that has 400 posts, and you decided to switch your domain and you were using write-in images for your thumbnails in the custom field. Now you have a huge problem because you need to go and replace each image URL to the new URL. Or lets say you wrote 50 posts and you spelled something wrong.  In this post we will show you how you can use an SQL Query for WordPress Database to Find and Replace text in wordpress database.

You need to go to your phpMyAdmin and select your database. Then click the button SQL. Once you have done that paste the following code:

This will work with any MySQL Database not just WordPress. Make sure that you make a backup of your database before you run this query.

In the example, we will be replacing the text WordPress to WordPress in our posts

Hit Done, and all will be replaced with one click. This is very helpful, and it can save you a lot of time.

Just please make sure to make a Backup of your Database.

Ashwani Bhatia

Ashwani Bhatia

Highly creative, innovative and multitalented web designer and developer with 9+ years experience in front end development technologies including advanced PHP,HTML5,CSS3, JavaScript, AJAX and Internet Marketing.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 4 = seven

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">