Skip to content

Instantly share code, notes, and snippets.

@marcbacon
Last active October 18, 2017 21:03
Show Gist options
  • Save marcbacon/2cf5806888d32ab8c484 to your computer and use it in GitHub Desktop.
Save marcbacon/2cf5806888d32ab8c484 to your computer and use it in GitHub Desktop.
[Change a WordPress Domain] Used to change a WordPress site's domain. #wordpress
//In wp-config.php:
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
//In functions.php:
update_option('siteurl','http://example.com');
update_option('home','http://example.com');
//In wp-config.php:
define('WP_SITEURL', ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']);
define('WP_HOME', ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment