Changing the domain in WordPress
Ce contenu n’est pas encore disponible dans votre langue.
Sometimes you may need to change the domain name of your WordPress site—for example, when migrating to a new domain or rebranding. On ruachost.com, you can update your WordPress domain settings using the dashboard, WP‑CLI, or phpMyAdmin.
Why Change the Domain?
Section titled “Why Change the Domain?”- Rebrand your site with a new domain name.
- Migrate to a different hosting environment.
- Improve SEO with a more relevant domain.
Step 1: Back Up Your Site
Section titled “Step 1: Back Up Your Site”Before making any changes, always back up your WordPress files and database. This ensures you can restore your site if anything goes wrong.
Step 2: Change Domain Settings
Section titled “Step 2: Change Domain Settings”Method 1: Using WordPress Admin Dashboard
Section titled “Method 1: Using WordPress Admin Dashboard”-
Log in to WordPress as an administrator.
-
Go to Settings → General.
-
Update the following fields:
- WordPress Address (URL) → Enter the new domain.
- Site Address (URL) → Enter the new domain. ⚠️ If your site has SSL, use
https://instead ofhttp://.
-
Click Save Changes.
Method 2: Using WP‑CLI (Command Line)
Section titled “Method 2: Using WP‑CLI (Command Line)”-
Log in to your hosting account via SSH.
-
Navigate to your WordPress installation directory.
-
Run the following command (replace with your domains):
Terminal window wp search-replace 'old.example.com' 'new.example.com'
✅ This updates all instances of the old domain in the database.
Method 3: Using phpMyAdmin
Section titled “Method 3: Using phpMyAdmin”-
Log in to cPanel (or your hosting control panel).
-
Open phpMyAdmin → Select your WordPress database.
-
Locate the wp_options table.
-
Update the values for:
siteurlhome
-
Save changes.
Step 3: Test Your Site
Section titled “Step 3: Test Your Site”- Visit your site with the new domain.
- Check for broken links or hard‑coded URLs.
- Set up redirects from the old domain to the new one to preserve SEO.
Important Notes
Section titled “Important Notes”- DNS propagation may take up to 24 hours.
- Always ensure the new domain points to your hosting server before updating WordPress.
- Consider updating your permalink structure and regenerating your sitemap.
Cette page vous a-t-elle aidé ?
Merci pour votre retour.