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
- Log in to your WordPress dashboard.
- Go to Settings > General.
- Scroll down to the WordPress Address and Site Address fields.
- Update the WordPress Address field to include the new domain (e.g.,
https://newdomain.com/wp-admin
). - Update the Site Address field to include the new domain (e.g.,
https://newdomain.com
). - Click Save Changes.
Step 2: Update your DNS settings
- Update your DNS settings to point the new domain to your existing WordPress site's IP address or server.
- 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
- Connect to your WordPress site's file system using an FTP client or SFTP client.
- Navigate to the
wp-config.php
file and update thedefine('WP_HOME', 'https://olddomain.com');
anddefine('WP_SITEURL', 'https://olddomain.com');
lines to reflect the new domain (e.g.,https://newdomain.com
). - Save the changes to the
wp-config.php
file.
Step 4: Update your WordPress site's database
- Log in to your WordPress database using a tool like phpMyAdmin.
- Update the
site_url
andhome_url
fields in thewp_options
table to reflect the new domain (e.g.,https://newdomain.com
).
Step 5: Test your new domain
- Visit your new domain in a web browser to ensure it's working correctly.
- Check that all pages, posts, and other content are being served correctly from the new domain.
Additional tips:
- Make sure to update any external links or URLs in your WordPress site's content to reflect the new domain.
- If you're using a caching plugin, you may need to clear the cache to ensure the new domain is properly propagated.
- If you're using a CDN or other third-party services, you may need to update their configurations to reflect the new domain.
By following these steps, you should be able to add a new domain to your WordPress site.