Select Page

Changing WordPress URLs in MySQL Database
December 16, 2018
Changing WordPress URLs in MySQL Database

Sometimes for some reason, we need to change WordPress URLs , but if there are too many, we need a batch processing method.

Step 1 - Go To Your phpMyAdmin And Select Database Then Head To SQL Tab

Step 2 - Enter The Following SQL Query

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

or

UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';UPDATE wp_posts SET guid = replace(guid, 'oldurl.com','newurl.com');UPDATE wp_posts SET post_content = replace(post_content, 'oldurl.com', 'newurl.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'oldurl.com','newurl.com');

Replace oldurl.com with your current WordPress address and newurl.com with your new WordPress address.

Step 3 - Press Go

Step 4 - Verify The Changes

Open the wp_options table and check the option_value of siteurl and home. You should see your new URL.

* Conclusion

In this tutorial, We just learned how to change WordPress URLs in the MySQL database using phpMyAdmin. I hope this post would help anyone who's searching change WordPress URLs in the MySQL database. Feel free to leave a comment if you have any question.

By Jackie Sung

Jackie Sung, also known by his nick-name KK, always strives for the best and learn from the best. Working and living as a Freelance Web Engineer/ Web Developer & Designer/ Amateur Youtuber/ Husky Lover.

Related Articles

How To Install and Configure Proxmox VE on Hetzner Server

How To Install and Configure Proxmox VE on Hetzner Server

Proxmox VE is a complete open-source platform for enterprise virtualization. With the built-in web interface you can easily manage VMs and containers, software-defined storage and networking, high-availability clustering, and multiple out-of-the-box tools on a single solution.

read more

0 Comments

Submit a Comment

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

Pin It on Pinterest

Share This