How to change the domain name on wordpress to a new domain name
Author: admin admin Reference Number: AA-00454 Views: 2256 Created: 2025-08-13 11:31 Last Updated: 2025-08-13 11:31 0 Rating/ Voters

How to Change Your WordPress Domain Name

Overview

This guide explains how to properly change your WordPress site's domain name to a new domain. Following these steps in the correct order is crucial to avoid website accessibility issues.

?? IMPORTANT: Order of Operations

You must update WordPress BEFORE changing the domain in cPanel. If you change the main domain in cPanel before updating WordPress, your site will continue redirecting to the old domain name, making it inaccessible.

Prerequisites

  • Access to your hosting cPanel
  • Your new domain name ready and pointed to your hosting
  • Basic familiarity with cPanel interface

Accessing Your cPanel

You can access cPanel through any of these methods:

  1. Login to the iFastNet client portal at: https://ifastnet.com/portal/clientarea.php
  2. Direct cPanel access at: https://yourdomain.com/cpanel (replace with your current domain)

Need Support? Create a support ticket at: https://support.ifastnet.com/login.php Note: First-time users will need to register an account to create tickets.

Method 1: Using phpMyAdmin (Database Method)

Step 1: Access phpMyAdmin

  1. Login to your cPanel
  2. Scroll down to the Databases section
  3. Click on phpMyAdmin

Step 2: Select Your WordPress Database

  1. In the left sidebar, click on your WordPress database name
  2. Look for a table named wp_options (the prefix might be different, like wp123_options)

Step 3: Edit Site URLs

  1. Click on the wp_options table
  2. Look for two rows with these option_name values:
    • siteurl
    • home
  3. For each row:
    • Click the Edit button (pencil icon)
    • Change the option_value from your old domain to your new domain
    • Example: Change https://olddomain.com to https://newdomain.com
    • Click Go to save changes

Step 4: Verify Changes

  • Both siteurl and home entries should now show your new domain
  • Close phpMyAdmin

Method 2: Using wp-config.php (File Manager Method)

Step 1: Access File Manager

  1. In cPanel, scroll to the Files section
  2. Click on File Manager
  3. Navigate to your website's root directory (usually public_html)

Step 2: Edit wp-config.php

  1. Locate the wp-config.php file
  2. Right-click and select Edit
  3. Find the line that says /* That's all, stop editing! Happy publishing. */
  4. Above this line, add these two lines:
define('WP_HOME','https://yournewdomain.com');
define('WP_SITEURL','https://yournewdomain.com');

Replace yournewdomain.com with your actual new domain

Step 3: Save the File

  1. Click Save Changes
  2. Close the file editor

After WordPress is Updated

Configure Your New Domain in cPanel

You have two options for setting up your new domain:

Option 1: Add New Domain (Recommended)

  1. In cPanel, go to Domains or Addon Domains
  2. Click Create A New Domain
  3. Enter your new domain name
  4. Set the Document Root to the same location as your existing domain (usually public_html)
  5. Click Submit

This option allows both domains to work simultaneously during the transition period.

Option 2: Change Main cPanel Domain (Optional)

Important: Changing the main cPanel domain requires support assistance and is optional.

  1. Contact iFastNet support to request the main domain change
  2. Create a support ticket at: https://support.ifastnet.com/login.php
  3. In your ticket, specify:
    • Your current main domain
    • The new domain you want to set as the main domain
    • Confirm that you have already updated WordPress to use the new domain
  4. Wait for support to complete the domain change before proceeding

Note: Option 1 is typically sufficient for most users and allows for easier management.

Test Your Website

  1. Clear your browser cache
  2. Visit your new domain
  3. Check that all pages load correctly
  4. Verify admin access at https://yournewdomain.com/wp-admin

Troubleshooting

If Your Site Still Redirects to the Old Domain:

  • Double-check that you updated WordPress BEFORE changing the cPanel domain
  • Verify both database entries or wp-config.php additions are correct
  • Clear your browser cache and cookies
  • Check if there are any caching plugins that need to be cleared

If You Can't Access Your Admin Area:

  • Use Method 2 (wp-config.php) as it often resolves access issues
  • Ensure the URLs in wp-config.php exactly match your new domain (including https://)

Additional WordPress Settings:

After the domain change, you may need to:

  • Update any hardcoded URLs in your content
  • Update widget settings that reference the old domain
  • Regenerate permalinks in Settings > Permalinks

Summary

  1. First: Update WordPress using either Method 1 (database) or Method 2 (wp-config.php)
  2. Second: Change the main domain in cPanel
  3. Finally: Test your website and update any remaining references to the old domain

Following this order ensures your WordPress site will be accessible on the new domain without redirect issues.

Quick Jump Menu