How to install WordPress on a temporary URL

  1. Home
  2. /
  3. WordPress How To Guides
  4. /
  5. How to install WordPress on a temporary URL

If you’re here you no doubt want to know how to install WordPress in a temporary URL. The good news is it’s really easy and just about anyone can do it.

A word of warning before we proceed. If you follow this guide and you are still unable to install WordPress in a temporary URL, it may be your hosting account. Ask your host if they are able to enable temporary domains on their system. Let’s begin

Install WordPress as you normally would on the usual domain name. Follow our guide here

Once installed use your favourite FTP manager or hosting file manager to access your wp-config file. The wp-config file is located in the root of the website folder

Open the wp-config file to edit the file

Right at the very top just below the opening <?php tag enter the following

define('WP_HOME','https://host1.swiftdesigns.com.au/~username');
define('WP_SITEURL','https://host1.swiftdesigns.com.au/~username');

Ensure that you swap out the host1.swiftdesigns.com.au for your hosting companies control panel URL and the username for your own hosting username.

At this point you can now try to load your website using the temporary URL. If your host allows temporary URL’s it should work well.

Now that you have learned how to install WordPress in a temporary URL you can build and make changes before going live. But there are a handful of caveats to remember.

Any absolute URL’s (the full https://www.host1.swiftdesigns.com.au~username/) that you enter on the temporary website URL will retain that when switching over to the live permanent URL. This will likely happen, but there is an easy fix that we will address at the end of the article.

When you have finished creating your site and are ready to send it live there are a few things that you will need to do.

First, open the wp-config file using the file manager or your preferred FTP software and comment out the two lines you entered above. Commenting out the lines will allow you to revert back quickly if needed. it should look like one of the below examples. Either will do

// define('WP_HOME','https://host1.swiftdesigns.com.au/~username');
// define('WP_SITEURL','https://host1.swiftdesigns.com.au/~username');
/*
define('WP_HOME','https://host1.swiftdesigns.com.au/~username');
define('WP_SITEURL','https://host1.swiftdesigns.com.au/~username');
*/

Now, log into your permanent URL. Your website should load the admin fine, but the frontend may be broken and some links will take you to the temporary URL. Let’s fix that

Go to add new plugin

In the search box search for Better Search and Replace

Install and activate the Better Search and replace plugin. It will be the plugin with the most ionstalls and highest reviews

Perform a full backup of the site

Go to tools, better search and replace

In the top search bar enter the temporary url. You only need to enter it as below

host1.swiftdesigns.com.au/~username

In the second box enter your domain name

yoursite.com

Notice how we’re excluding the https, www and trailing slashes

Select the tables to run the search and replace on. To select all tables click the top row and then holding shift click on the bottom row. This will select all rows

Make sure do a dry run is checked and click go

Once it has finished it will tell you how many cells and rows will be updated and it wit was successful. If it looks like everything went well select the tables and uncheck the dry run checkbox and hit go

Once it has finished all URL’s using the temporary URL will be rewritten to the permanent URL

0 0 votes
Article Rating
Spread the love
Written by: John Cook

Written by: John Cook

Author

About: I'm John Cook. I'm a qualified web developer and data scientist, currently undertaking a Masters of data science at UNSW and a Masters of information technology with a specialisation in cybersecurity at CSU in Australia, a blogger, developer and WooCommerce fanboy. As the founder of Swift Designs, WC Success Academy, Wiz Plugins, Commerce Mania and Learn WP by Swift Designs, my goal is to empower website owners around the world to take full control of their WordPress powered websites. I've been developing websites for close to 10 years and have a deep understanding of WordPress and how it works. As an active plugin developer with several plugins in the WordPress plugin repository, this gives me a unique understanding of the inner workings of WordPress. My goal with Learn WP is to allow WordPress website owners the ability to discover the true potential WordPress has to offer in an uncomplicated and easy to understand way
Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments