WordPress migrations are a major part of the WordPress Management Service that we offer at Bobcares.
At times we receive requests to migrate websites to a completely different domain name. As WordPress stores all details in databases, we often need to edit the URLs manually to correct them.
Find and replace option in phpMyAdmin is the option that we often follow for this purpose. It is a process that automatically looks for a word in a database and replaces it with another.
Let us discuss in detail about this method today.
Why do we need this Find and replace?
Find and replace option in the phpMyAdmin option is very useful if we have multiple words to replace in a database.
By using this option we can change a URL, an image, or even a text on the website in less time.
Mainly we choose this option after the Website Migration for replacing the old domain data in the database with the new ones.
Let’s see how we perform this Find and replace.
How we do Find and replace using phpMyAdmin?
The steps to do a find and replace using phpMyAdmin are:
1. Initially, log in to the cPanel.
2. Then click on phpMyAdmin.
3. After that, click on the Database.
4. On the right-hand side, the tables of the selected database will get listed. Then we click on the table in which we want to do the search and replace process.
5. Next, click on the Search option on the top.
6. After that, click on Find and replace button on the top.
7. Then we provide the string that we want to replace in the Find section and new string in the Replace with section.
8. The Column option contains the below values.
option_name
option_value
autoload
Then select each column value from the dropdown list and click Go.
Note: We cannot replace all columns in a database at once as the Plugin works. We have to select the column in one by one manner.
This is a good option when the Find and Replace plugins are not working.
Our Engineers always perform a Database backup before proceeding with Find and replace.
Find and Replace by SQL Query
We use phpMyAdmin to find and replace text by running a SQL Query. Here, we follow the steps:
- Initially, open the phpMyAdmin and we click on the website’s database.
- Then in the new window, we click on SQL from the toolbar and write the below query.
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, 'Text to find', 'text to replace with');
- Finally, click on the Go button to continue.
After the query ran successfully, the phpMyAdmin shows the number of rows affected by the query.
[Need more assistance with Find and replace in phpMyAdmin? Click here to talk to our experts.]
Conclusion
In short, we discussed in detail the Find and replace in phpMyAdmin for replacing the words in the database easily after migration or any other scenario.
Thank you very much
Hello,
Thank you for your feedback! We are delighted to hear that our article was helpful to you.