Page 1 of 1

Wordpress - how do you set the domain if you move the site?

Posted: Wed Mar 02, 2016 8:51 am
by simonmlewis
So we have a Wordpress site build on the site's sandbox subdomain.

It's all moved over.

But when I go to wp-admin, it tries to redirect me to the sandbox.domain.com. If I add

Code: Select all

define('WP_HOME','http://www.site.co.uk');
define('WP_SITEURL','http://www.site.co.uk');
to the wp-config, the site loads, but all css and imagery go. So it's breaks.

Are there two places to set the URL?? Or even in the database?

Re: Wordpress - how do you set the domain if you move the si

Posted: Thu Apr 07, 2016 2:46 am
by twinedev
This is a little old, so you may have solved this, but I will reply anyway in case someone else reads it having the same issue.

You also need to update any content that has the domain coded in (ie. You added media to the page, it will be hard coded to the full URL to the item, it will need to be found and changed in every post.)

The easiest way to do it is use a plugin for moving sites. I myself normally use Duplicator Plugin. When you package up the site, just use it's migration wizard. Upload the package to the "production" server, browse to it's .php file, and from there tell it what the new install settings are, and let it go. It will install the database, put files in place, and search database entries for both URL and table prefix changes and update any needed records. When all done, you can remove the plugin if you don't need it further.