Search and Replace in PHPMyAdmin database for Wordpress (absolute beginner)

364
June 06, 2017, at 01:06 AM

I apologise in advance for I know that this question has been asked several times already, but being a complete beginner at wordpress coding and database handling, I am still not sure about what those answers really meant. So having just coded a website and converted it into WordPress, I now find myself having to change all of the localhost strings to the accurate ones, but with hundreds to go through, I just wanted to know if any of you were able to recommend a program or technique within PHPMyAdmin (that I may not be aware of) to avoid having to change them one at a time. Thank you all in advance for your time and attention.

Answer 1

In phpMyAdmin open your table, choose Search > Find and replace. Then specify in which column you want to find and replace, and the original and replacement texts.

Answer 2

Without any doubt I would use http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

This tool is especially designed for the situation you describe.

You upload the code to your server and then enter the "find" and "replace"

You can then do a dry run and the system will show you all the replaces that will be made across every single table in your Wordpress database.

Once you're happy then you can do a live run and the changes are made.

I have used this on probably one hundred Wordpress sites and it works a charm.

Answer 3

First, let me start by saying this is very dangerous, especially for an absolute beginner such as yourself. Please use this with extreme caution as you can potentially bring the entire site down by replacing values in your database with the wrong data.

With that said, there is a script specifically designed for doing search and replace on the WordPress MySQL database. http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

Here's the direct download link: https://github.com/interconnectit/Search-Replace-DB/archive/master.zip

You will extract the folder from the donwloaded zip, then upload the folder to the root of your WordPress install. Once its uploaded just reference the folder in the browser. I always rename the folder to sr (shorthand for search and replace) so its easier to write out the full URL. So as an example, once its in the root of the WordPress install you'd access it like www.example.com/sr/.

After you access the script in the browser, you'll have a GUI with two boxes at the top. The first you'll enter the string you're searching for, and the replace string goes in the second box. Your MySQL details/login should already be populated. After entering your S&R terms scroll down and click "Update Details", then do the "Dry Run" option first. It'll run through the database and show you the values that will be changed. If you are satisfied with the changes, click "Live Run".

Depending on the database size it'll take just a short time to complete. This is the easiest way to S&R the WordPress database.

Important: for security reasons you'll want to delete this folder from your server after you have finished using it. You don't want a database S&R utility just lingering around for now reason.

Another possible option if you're familiar with WP-CLI is to use the wp search-replace command: https://developer.wordpress.org/cli/commands/search-replace/ This would be done through Terminal or another command line utility.

READ ALSO
Mysql - Netbeans, Column statusid cannot be null?

Mysql - Netbeans, Column statusid cannot be null?

I wish to test POST in postman api, and I have a table called transaction

315
name cytoscape's nodes by primary key in mysql table

name cytoscape's nodes by primary key in mysql table

I'm trying to display a network using cytoscape based on a mysql database, I've got two tables, one contains the name (device_id), ip and SN that means serial number (PK) of each device in the network, the otherone has relation's info: origin's SN destiny's...

241
Adding code to MySQL database

Adding code to MySQL database

I have recently being using XAMPP and phpMyAdmin to create databasesI have php scripts to update and read from the database and thats all good

237