Add new domain to wordpress

To add a new domain to a WordPress site, you'll need to follow these steps:

Step 1: Update your WordPress configuration

  1. Log in to your WordPress dashboard.
  2. Go to Settings > General.
  3. Scroll down to the WordPress Address and Site Address fields.
  4. Update the WordPress Address field to include the new domain (e.g., https://newdomain.com/wp-admin).
  5. Update the Site Address field to include the new domain (e.g., https://newdomain.com).
  6. Click Save Changes.

Step 2: Update your DNS settings

  1. Update your DNS settings to point the new domain to your existing WordPress site's IP address or server.
  2. You can do this by creating a new A record or CNAME record in your DNS provider's control panel.

Step 3: Update your WordPress site's files

  1. Connect to your WordPress site's file system using an FTP client or SFTP client.
  2. Navigate to the wp-config.php file and update the define('WP_HOME', 'https://olddomain.com'); and define('WP_SITEURL', 'https://olddomain.com'); lines to reflect the new domain (e.g., https://newdomain.com).
  3. Save the changes to the wp-config.php file.

Step 4: Update your WordPress site's database

  1. Log in to your WordPress database using a tool like phpMyAdmin.
  2. Update the site_url and home_url fields in the wp_options table to reflect the new domain (e.g., https://newdomain.com).

Step 5: Test your new domain

  1. Visit your new domain in a web browser to ensure it's working correctly.
  2. Check that all pages, posts, and other content are being served correctly from the new domain.

Additional tips:

By following these steps, you should be able to add a new domain to your WordPress site.