WordPress Snippets at WPcustoms

Change WordPress site home url in wp-config

In case you locked yourself out of your WordPress install by setting a wrong URL this may save you some hours messing with phpmyadmin. Just insert it into wp-config.php – don’t foget to adjust the urls. This way you can easily change your Home and Site URL (set in settings -> general)


/**
 * Snippet Name: Change WordPress site home url in wp-config
 * Snippet URL: http://www.wpcustoms.net/snippets/change-wordpress-site-home-url-in-wp-config/
 */
 // add these lines to your wp-config.php file.
update_option('siteurl','http://yoursite.com/wordpress'); // WordPress Address (URL)
update_option('home','http://yoursite/wordpress');  // Site Address (URL)