Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Change The Site URL of a Wordpress installation

DZone's Guide to

How to Change The Site URL of a Wordpress installation

· Web Dev Zone ·
Free Resource

Learn how error monitoring with Sentry closes the gap between the product team and your customers. With Sentry, you can focus on what you do best: building and scaling software that makes your users’ lives better.

When you install Wordpress it saves the current address in the db keeps using it.  If you install it on production and start using Wordpress then you'll be fine.  How I use wordpress is I first install it on my machine, setup plugins, themes etc.  When the site looks alright I move it live server.

I also make sure that the db name, user and password are the same on development and production server.  Here is what I use to make the installation work i.e. Wordpress ignors the site url saved in the db.

Add these lines in config.php to make the installation work on dev and on production

define('WP_HOME','http://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL','http://' . $_SERVER['HTTP_HOST']);

What’s the best way to boost the efficiency of your product team and ship with confidence? Check out this ebook to learn how Sentry's real-time error monitoring helps developers stay in their workflow to fix bugs before the user even knows there’s a problem.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}