Updating WordPress Database After Website Move

Boy life sure would be easy if WordPress used relative URL’s throughout the menu and post content but that simply isn’t going to happen, they’ve made that clear. Changing the URL in the admin Settings would then be all you need to do, making moving installations a breeze. Not the case, we should stop crying about it.

There are a few plugins that will migrate WordPress without much fuss. Our favorite is All in One Migrate. The free version only allows migrations of 500MB or less.

If you’re forced to do a manual transfer, all you’ll need is a couple additional steps. We’ll assume you changed the URLs in your admin settings. Now simply log into your hosting cpanel and get to PHPMyAdmin, then find your database. If you need your database name then head over to your file manager and locate the wp-config.php file in the website’s main directory. It’s there under db_name.

Once you’ve located your website’s database in PHPMyAdmin, select SQL (see image below) to enter the following statements, replacing the new and old URL’s with your values. Be sure the table names match up, yours may have the prefix wp_, or more likely something like wp_123_. Just be sure the table names match when you execute this SQL. Be sure you’ve updated your wp_options table – this is already updated if you changed the URL in your admin Settings.

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

wordpress change url database

More Web Design Blog Content
When To Get A New Mac

When To Get A New Mac

MacBook Running Hot and Sluggish? It Might Be Time for a New One If your MacBook Pro has started running hot, fans are constantly spinning, and everything from Safari to Finder feels like it’s stuck in molasses—you’re not alone. These are some of the most common signs that

How To Win Visitors And Influence Traffic

Is there anything more of a turn-off than a untrustworthy website? Not in our world. Increasing the trust in your website is key to making conversions (calls, emails…. sales … you know, money). There are a number of factors determining the level of trust on your website. Here’s

Why Website Speed Matters More Than Ever in 2024

In today’s fast-paced digital world, website speed is crucial. Users expect instant access to information, and a slow website can significantly impact your business. Here’s why website speed matters more than ever in 2024 and how you can improve it. The Importance of Website Speed User Experience When

Jquery XML Shopping Cart

We’ve built all kinds of shopping carts – many from the ground up. Experienced with all the third party vendors – zencart, opencart, xcart, etc… we know that clients need something completely customized sometimes. Many shopping carts are simply to complicated for some clients to use – also

Getting Accurate Shipping Rates

If you own an ecommerce store and provide real time shipping rates you have likely encountered a long list of issues with returning accurate rates. If you have not, Bravo good sir or madam! You are the exception. Having real-time shipping rates on your online store is a