Need help? Book our fixed price WordPress Support service.

Override Site URL in wp-config.php

It is possible to set the site URL manually in the wp-config.php file to override the database values. This is useful when syncing a database from the live site.

Add these two lines to your wp-config.php, where “example.com” is the correct location of your site.


define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Reference: https://codex.wordpress.org/Changing_The_Site_URL

Was this article helpful?

No 0

About the Author

Christian Mayne is a full time WordPress developer and consultant based in the UK. He runs a UK based WordPress development agency with clients all over the World. As well as WordPress development, Christian has been teaching WordPress use and development since 2014 in classroom settings and online.

LEAVE COMMENT