I develop my Wordpress site from the localhost, name: http://moingaytoisong.dev
My real website is : http://moingaytoisong.com
Every time I pull the database from the live site to my local site, I need to search and change the url in wp_options table. It's quite frustrate.
Do you have any better idea?
In your wp-config.php, just need to add these lines below:
It will overwrite the url in database, so no need to change the url in wp_options anymore. Your local website and your live website can use the same database without any issue
I think you should check some plugins. You can use wp-migrate-db to migrate your database according to your host. You can use Duplicator plugin to shift your site from one host to another in a few simple clicks.
For Duplicator check this https://www.youtube.com/watch?v=tdP3quWLM0Q