Somehow my blog got stuck after loading the page up to the post's title. After…
If you want replacing something which appears in many posts and doesn’t want to do one by one at a time, what do you need to do?
All of us knowing that when replacing things in your blog, it’s a nightmare and time consuming, but don’t worry there is an alternative for you to take care these stuffs without wasting of your time; just one click, all of them are replaced. Then next time if you want to change something, you’re no longer afraid of touching your database and one day you might be a database expert, who knows.
Here is what you need to do:
- Log in your phpMyAdmin
- Click on the database table you need to change (usually, these db are displayed on the left hand side of the screen)
- Click on SQL which is on the top panel of the right side of the screen.
- In the big empty box, place the following code
UPDATE tablename SET tablefield = replace(tablefield, "find_string", "replace_string");
UPDATE wp_posts SET post_content = replace(post_content,"Money","2013 money");
– The above code is about replacing the word “Money” to the phrase “2013 money” in the content of the post.
– Change wp_posts to the name of your database table.
– Change post_content to the name of the table you want to change.
– Change the word “Money” with the word/phrase you’re looking to replace and
– Change the word “2013 money” to the word/phrase you want to replace the word “Money“.
- Click Go
- After it’s completed, a green message will pop up letting you know that’s done and how many queries which it had taken care off.
- That’s all you need to do.
*** WARNING ***
Before starting to do anything with your database, you need to backup it just for in case you did something wrong and the database is broken, you won’t be panic and your blog is able to recovery.