The Best Free WordPress Tutorials to Master WordPress

How to Change WordPress Domain Name?

0 626

Some projects need to change their brand name sooner or later. In this guide, we will show you how to change a WordPress domain for a website using WordPress Hosting.

Why Should You Change Your Domain Name?

Most of the time, WordPress domain change becomes inevitable. The most common situations that require this action are:

  • Brand Name Change  – you may want to renew your company’s image with a new brand name. A new domain rebrand shows the consistency of the strategy. Famous brands such as Twitter have implemented this marketing strategy very successfully.
  • Domain Extension Change  – if you  have a website  with a subdomain like websitem.wordpress.com or you have a popular extension like .mobi or .shop that doesn’t quite fit your audience, switching to a different extension can be a great idea!

How to Change WordPress Domain?

Most of the time the WordPress domain rename process is easy, but there will be some tasks that will require you to change your site’s PHP code .

Remember that editing the code puts your website at risk if not done correctly. Before you change your domain name, make sure you follow these prerequisites:

  • Take a full backup of your site. – Taking a full backup will help you recover or restore your website as fast as possible if you encounter any problems. You can automatically back up your site with a plugin or your hosting provider’s file manager .
  • Plesk Panel or FTP client – if you want to change WordPress domain, you will need to login to your Plesk Panel or use an FTP client.
    A new domain name  – you should do some good research before making your final decision .

1. Get a New Domain

First of all , go to Porkbun’s domain checker and enter your preferred domain name. You will see if your chosen domain name is available and you will receive a few alternative suggestions.

Then add your domain name to the cart and proceed to checkout.

2. Add New Domain and Upload Backup

In the next step, you must add the new domain name to your existing hosting plan.

  1. In Plesk Panel go to Add Domain.
  2. Add your new domain create a password and click Add Site .
  3. Connect with FileZilla and backup your site.

NOTE: If you are using Cloud Hosting , you must also backup the database. If you’re using shared hosting, you don’t have to worry about that.

3. Change Website URL Using WordPress Admin Control Panel

The next step for WordPress domain change is to add your new domain to WordPress General Settings .

Go to Control Panel -> Settings -> General . Replace your existing  WordPress Address (URL to visit your site)  Site Address with your new domain name. Press Save Settings after you are done .

We’re not done yet. Complete the following steps before accessing your site using the new address.

4. Update the wp-config.php File

You need to edit the wp-config.php  file for the changes you made in the WordPress settings to take effect . You can access this file using Plesk Panel’s file manager or FileZilla . For this example we will use hPanel:

  1. Go to Plesk Panel  -> Files -> File Manager .
  2. Choose your domain name and Go to File Manager ( Go to the File Manager) ‘click.
  3. Locate the wp-config.php  file in the public_html folder .
  4. Right-click and  select Edit .
  5. Replace http://yoursitename.com with your new WordPress domain name in the code snippet below. Then put this code in your file and press Save & Close.
define ( ‘WP_HOME’ , ‘http://yoursitename.com ) ;
define ( ‘WP_SITEURL’ , ‘http://yoursitename.com ) ;

Your wp-config.php file should look like this:

If you prefer to do this using an FTP client, the process will not be much different. All you have to do is use your FTP account information to access your site’s files.

 5. Update Your Database

The next thing you need to do is to update your WordPress site database:

  1. Go to hPanel -> Databases -> phpMyAdmin .
  2. Select the database where your WordPress files are located and  click phpMyAdmin .
  3. Select the wp_options  file on the phpMyAdmin  page  .
  4. Click Edit in the site URL  and  home  sequences  .
  5. Replace the existing URL with your new domain and  click Go .

6. Permanently Forward Your Old WordPress Domain

The last step required for WordPress domain change is to make a 301 redirect, that is, a URL redirect from your old domain to the new one. In addition, thanks to the redirect, Google’s PageRank will be moved and all your SEO efforts will not be wasted when moving to the new domain.

We recommend keeping your old domain active for a short time. This allows users to find you if they are not aware of the domain change, and allows search engines to recognize the change.

Now you will need to go to hPanel and  edit the .htaccess  file and create a 301 redirect:

  1. Go to Plesk Panel -> Files -> File Manager .
  2. Choose your old domain and Go to File Manager ( Go to the File Manager) ‘click.
  3. Find the .htaccess  file in the public_html folder .
  4. Right-click and  select Edit .
  5. http: //sitenizinadi.com Place the following code after the change to your new domain and Save & Close ( Save & Close) ‘Click.
#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^ ( .* ) $ http ://yoursitename.com/$1 [R=301,L]

 

Just like the  step where you edit wp-config.php , this step can be done with an FTP client.

Conclusion

There are many reasons why you should perform a WordPress domain change. Luckily, WordPress has built-in URL address settings and allows you to manually edit PHP code and change your domain name via a file manager or an FTP client.

In this guide, you have learned the steps to change a WordPress domain name. Here is a brief summary of these steps:

  1. Buy a new domain.
  2. Change your website address in your WordPress settings.
  3. Update the wp-config.php file via hPanel or an FTP client .
  4. Update your site database.
  5. Edit the .htaccess file to direct visitors and search engines to your new domain name  .

That’s it. Good luck!

You might also like
Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More