HomePC relatedWordpress tricksWordPress global search and replace Log in

wordpress-logo

I moved this site from blog.jamesjpn.com to jamesjpn.net. A problem I faced was there were 678 lines of code that pointed to photos on the blog.jamesjpn.com server and I needed to edit the posts to point the links to the new server on jamesjpn.net. Thanks to http://www.barrywise.com/2009/02/global-find-and-replace-in-wordpress-using-mysql/ I learned how to do a global search and replace in the Sql section of phpMyAdmin!

UPDATE wp_posts SET post_content = REPLACE(post_content, ‘blog.jamesjpn.com’, ‘jamesjpn.net’)

It would have taken me a long time to do the job by editing each post, whereas Sql did a global search and replace of 678 lines of code in only 0.8187 of a second!

Be Sociable, Share!

About James Arendt

Born in 1950 and raised in Chicago Illinois, USA.
Served in the USAF from 1970 in San Antonio, Texas, Biloxi Mississippi, Sacramento California and Asaka, Japan and honorably discharged in 1974.
Became a full time missionary for Christ and served in Russia, China and Japan for 44 years and counting.
Lives by faith in God's supply with no fixed job or income.
More about the webmaster.

I need your help to keep this website going! I would like to upgrade to better and faster web-hosting at WpEngine https://wpengine.com. Better and faster hosting means better Google rankings and more visitors. At $348.00 a year at WpEngine, I cannot afford to upgrade at this time. I currently pay 70 bucks a year for el cheapo hosting. In the past, this website often crashed on the server.

If you find anything on this site that is a blessing to you, please help support it with a gift. My PayPal account is
[email protected]
When I get enough money, I will move this website to WpEngine. And if you sent me a donation, you will be immediately notified about the upgrade to better hosting. Thank you.


Comments

WordPress global search and replace — No Comments

Leave a Reply

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

 characters available