What is the best way to configure when changing a host in Wordpress?

I create my Wordpress site with localhost, name: http://moingaytoisong.dev My real site: http://moingaytoisong.com Every time I bring the database from live to my local site, I need to search and change the URL address in the wp_options table. This is pretty tricky. Do you have an idea?

+4
source share
2 answers

In your wp-config.php just add the following lines below:

define('WP_HOME','http://moingaytoisong.dev');
define('WP_SITEURL','http://moingaytoisong.dev');

It will rewrite the url in the database, so you no longer need to change the url in wp_options. Your local website and your real-time website can use the same database without any problems.

+4
+2

All Articles