Select Page

Changing WordPress Urls In Mysql Database
Posted on December 16, 2018
Changing WordPress Urls In Mysql Database

Jackie, 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. If you love one of these things that I love, we already have something in common.

Jackie Sung

Owner

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.

Related Articles

0 Comments

Submit a Comment

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

Pin It on Pinterest

Share This