So there are times that I go through needing to setup a dev environment and I find that I want to only have to edit the wp-config.php file as to the site’s URL. This allows me to login to the admin area without having to worry about what is in the database for the Site URL or Home URL. Editing the wp-config.php file and adding this down where the debug line is can easily do this.
define( 'WP_HOME', 'http://example.com' ); define( 'WP_SITEURL', 'http://example.com' );
On the Settings -> General screen in a single site installation of WordPress, there are two fields named “WordPress Address (URL)” and “Site Address (URL)”. They are important settings, since they control where WordPress is located. These settings control the display of the URL in the admin section of your page, as well as the front end, and are used throughout the WordPress code.