Knowledge Base
MilesWeb / WordPress FAQ

Configure WordPress with a New Domain in Easy Steps for Better Working

Approx. read time : 3 min

Let’s assume you were using abc.com domain for your blog and later you decide to change it to xyz.com. Because of reasons like low traffic, not related to your niche, already purchased by someone but the extension is different, domain is blacklisted but after buying you came to know, etc.

So, you might get stuck how to replace the old domain name with the new domain name. Not to worry, if you are planning to use WordPress on a new domain then you need to follow a few steps for the smooth working of your new domain in WordPress. Those steps are mentioned below:

First Step: Using the WordPress Dashboard

Being a WordPress site owner, this step is easy for you to follow and implement. Go to setting > General and replace WordPress Address and Site Address with the new domain that you want to utilize for your WordPress website.

• The “Site Address (URL)” in the setting is the address that you want people to type or browse to land on your WordPress blog.

• The “Site Address (URL)” in the setting is the address that comprises of WordPress core files reside.

Second Step: Via FTP

You can also add the new domain in your WordPress site via FTP. This method is useful, if you have the right to access your website via FTP. Moreover, this will easily help you to get a website back up and run the same, if values are entered incorrectly in the dashboard.

Edit wp-config.php

You can also place the site URL manually in the wp-config.php file.

To follow the same insert these two lines to your wp-config.php, where “yourdomainname” is the right location of your WordPress site.

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

This may not be the best fix because it’s a hardcoding of the values into the website source code and you can’t do the same in the general settings page.

Edit functions.php

1. You need to download a copy of the active theme’s function.php file. Edit that downloaded a copy in a simple text editor and upload that edited copy again on the website.

2. Insert these two lines to the file, next after the initial “<?php” line.

update_option( 'siteurl', 'http://yourdomainname.com' );

update_option( 'home', 'http://yourdomainname.com' );

3. Upload the edited file again on the website without changing the location.

4. Refresh the login or admin page multiple times, to get the same site again with the backup.

Note:

i) Don’t leave those lines in the function.php file. Remove the lines once the site is live.

ii) In case, your theme is not supporting a function.php file then you can create a new file known as function.php in a text editor and implement the above-mentioned steps.

Third Step: Using phpMyAdmin

You are required to change the website URL and home options in your WordPress database. You can do this into the cPanel > phpMyAdmin.

In phpMyAdmin, choose your WordPress database and browse the table wp_options. Search the alternatives siteurl and home and replace their values to the new domain that you want to display publicly.

Last but not least don’t forgot to clear the cache of your browser and check whether your website is working or not.

Trusted By Thousands of Clients & Big Businesses

We highly appreciate the kind and stellar feedback we receive from our customers. Delivering the best is our goal! MilesWeb is rated Excellent out of 5 based on reviews. Read more reviews.

Excellent
Based on reviews
2 hours ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
4 hours ago
Milesweb is superb Hosting pro...
Milesweb is superb Hosting provider ever, their Support team is amazing!!!...
Abhishek Singh
15 hours ago
Great support in great timing...
We need urgent assistance on changes in a primary domain on our client's Cpanel accounts and reached...
Riyaju Deen
21 hours ago
Best Website Hosting platform ...
I was new on MilesWeb. And needed help on multiple areas from setting up to getting started with cre...
Harshada
1 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
1 days ago
the team is very supportive th...
the team is very supportive though at times effort needs to be made to make understand the problem s...
Suree Sharma
1 days ago
I am using miles web for 3plus...
I am using miles web for 3plus years, very quick and perfect support by the team, they helped me man...
Sri Raghav
2 days ago
The service is good...
The service is good. They are answering with patience and doing the needful as soon as possible....
MR
2 days ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
3 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
4 days ago
positively helped me with find...
positively helped me with finding insecure content on my website causing SSL to not work properly on...
Thaviraj Junglee
4 days ago
Exceptional support, Truly Pra...
I had opted for the basic wordpress hosting plan as I intended to experiment with various plug-ins. ...
Aseem Chandna