Tsohost Knowledge Base

Remove the '.gridhosted.co.uk' preview URL from a Wordpress site

Modified Tuesday 20th October, 2015 at 10:30

Was this helpful?

When you've finished building your Wordpress site and pointed your domain's DNS to the Cloud, Wordpress will still redirect to the preview URL until you complete the following step. This is because Wordpress builds URLs from the 'site address' and 'wordpress address'. You'll need to change these back to exclude the '.gridhosted.co.uk' part in the site's URL.

In most cases you can change the site and wordpress address from the Wordpress dashboard itself, by going to Settings > General

However if you're unable to log into the Wordpress dashboard, you can also do it manually by either:

  1. Defining them in your wp-config.php, or;
  2. Changing them from the database (advanced)

1. Defining them in your wp-config.php

Using either FTP or the file manager in your Cloud dashboard, navigate into your site's live files (usually the public_html) directory and find your Wordpress installation. Edit the file called 'wp-config.php' and at the bottom of the file above the final 'require' line, add (or amend) the following lines excluding the '.gridhosted.co.uk' part, then save it:

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

2. Changing them from the database

Find your wp-config.php as above and open it in a text editor, looking for the database connection string (it will define a db_name, db_user, db_password and db_host). Now open up a new browser window or tab, and go to https://phpmyadmin.gridhost.co.uk and log into PHPMyAdmin using the db_user, db_password and db_host (select the db_host from the drop-down menu). On the left-hand side you'll see any databases that the db_user has privileges to on that database server; click the one which you saw in your wp-config.php as db_name, then click on the xxxx_options table. Now find the rows called 'siteurl' and 'home'. Edit these by clicking on the small pencil icon, and remove the '.gridhosted.co.uk' part then click 'Go' to write the changes to the database. Note that however the site/wordpress URLs are set in the Wordpress dashboard or the database, these will be superceded if defined using php in the wp-config.php.

If you're still stuck, feel free to contact support.


previewlinkgridhostedgridhosted.co.ukurlwordpresscloudMostPopularArticle

Still can't find what you're looking for?

That's not a problem. Our 24/7 customer support team are friendly and waiting to help answer your questions. The easiest way to get in touch is to raise a support ticket; simply click the button below.

Open Support Ticket