How to Create a Temp URL for WordPress Development

by | May 27, 2015 | How To, Hosting & DNS, Wordpress | 8 comments

If you’re a WordPress developer/designer, especially a freelance developer, you know how beneficial it is to develop a site while it’s live. Not only is it helpful when debugging plugins/themes/etc…but it’s great to be able to give your clients a URL that will allow them to access the live site and view it for review purposes. Not only that, it’s awesome to be able to check a live site on a mobile phone and tablet too.

Did your client purchase hosting somewhere else for the new website? Cool, hopefully it was SiteGround WordPress Hosting. Now how do you develop new a WordPress website without any downtime of the current website? Easy, there are many ways to do it, but today I’m going to show you my general process to create a temp url when developing a website on the new server.

New Way (Siteground Hosting changes in 2020)

2020 Update for Siteground

New siteground panel

If you connected a domain name follow these steps

Create New Website

install empty website

go back to panel

go back to websites

delete the current website

make a new website

create a tempory domain

Create empty site (we don’t need the domain currently, but we nneed to finish the installation, so creating this empty site would take less time thann installing WP on it)
2. Deleting the site – so that we can later rename the temporary domain to the live site after you are satisfied and point the DNS > Websites > Manage (on the site if you have more than one) > 3 dot menu > Change Primary DOmain

OLD WAY (can be used for some hosting evironments)

1. Install WordPress using the any domain name available during the installation process. Usually with apps like softaculous, they make it easy to setup and install right on the server in your chosen location. If it’s a new server and the only website, I like to install right on the root.

Afterwards you will have to configure the WordPress application with the temporary URL(which is either the shared IP or the server hostname).

2. After you have setup FTP, got to phpMYadmin and find the wordpress options table and replace siteurl and home with the new temp URL you want to use. You may want to use the IP address of the server you are on. So for example http://818.555.342.341/~newurl

Changing siteurl and home in phpmyadmin for worpdress url

3. Open .htaccess via FTP and find the following code in your file

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Now it should be changed to reflect the rewriting of the new URL:

RewriteEngine On
RewriteBase /~newurl/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~newurl/index.php [L]

Now open your website with the new temp domain you created. Build your new website and point the nameservers when your all done.

These are the steps I take when creating a temp URL for a client on a new server. When using an existing server, I just install WordPress in a subfolder and develop that way. It’s super easy to replace the current website on the root with the new website when ready.

Alternatively, you can force WordPress to read a new domain a couple different ways, but it may or may not work for everyone depending on their hosting environment and how they have setup everything.

Adding this code to the functions.php file of the theme or child theme that is currently active.


Adding this code to wp-config file.


When Switching to the New Domain

  • Change the DNS/Nameservers to the new server.
  • Check .htaccess and remove any caching code and any references to the temp domain.
  • Check wp-config.php file and make sure the new domain is set and not the temp domain.
  • Run a search and replace script to replace the old domain with the new one (for advanced users only)
  • If having any problems, check in phpmyadmin to make sure the domain was switched inside the options table for wp.
Ravenous Raven Design
Google Rating
Based on 21 reviews