When you migrate your site to a new domain or need WordPress to respond under a different address, pointing the domain at the hosting level isn't enough: you must also tell WordPress what its primary address is. If you only make the change on the server and skip this step, it's common to run into:
This guide shows you how to update the primary domain directly from WordPress's internal settings, as well as the steps needed for the entire site to work correctly under the new domain.
Keep these points in mind before making the change:
Within WordPress there are two key addresses that define your site's domain:
siteurl: indicates where the WordPress core files are located.home: the address visitors type to reach your page.In most installations, both addresses point to the same domain and must be updated together when changing the primary domain.
This is the simplest and recommended method when you still have access to wp-admin.
Access your dashboard at https://yourdomain.mx/wp-admin with your username and password.
In the sidebar menu, go to Settings → General.
Edit the two fields so they reflect your new domain:
https://newdomain.mxhttps://newdomain.mxScroll to the bottom of the page and click Save Changes. WordPress will log you out and you'll need to log back in using the new domain.
Note: If these fields appear grayed out or can't be edited, it means the addresses are defined in the
wp-config.phpfile. In that case, use Method 2.
Useful when the dashboard fields are locked or you prefer to set the addresses via code.
Access your account at https://my.webzi.mx.
Go to File Manager and navigate to the folder where WordPress is installed (usually public_html).
wp-config.php file.
- define('WP_HOME', 'https://newdomain.mx');
- define('WP_SITEURL', 'https://newdomain.mx');
Note: As long as these lines exist, the Settings → General fields will remain locked, since the file takes priority over the database.
Recommended as a recovery method when you've lost access to the dashboard (for example, a redirect loop after an incorrect change).
From cPanel, go to the Databases → phpMyAdmin section.
In the left panel, choose the database that corresponds to your WordPress installation.
wp_options table. The wp_ prefix may vary depending on your installation (for example, wpab_options).option_name is siteurl and home.option_value with your new domain: https://newdomain.mxChanging siteurl and home only modifies the primary address, but it does not replace the thousands of references to the old domain that remain within your content: internal links, image paths, plugin settings, and theme data. That's why a bulk URL replacement is necessary.
Install a free plugin such as Better Search Replace, which replaces URLs safely even within serialized data:
https://olddomain.mxhttps://newdomain.mxNote: Avoid running a direct replacement with SQL queries (REPLACE/UPDATE) across the entire database, as it can corrupt WordPress's serialized data. Always use a tool that respects serialization.
If your account has SSH access and WP-CLI, you can do it from the terminal:
- wp search-replace 'https://olddomain.mx' 'https://newdomain.mx' --dry-run
- wp search-replace 'https://olddomain.mx' 'https://newdomain.mx'
Once the domain has been updated, make these final adjustments:
.htaccess rules.https://) across all addresses to avoid inconsistencies.At Webzi, we're committed to keeping your services running smoothly. If you have questions about this procedure or need help carrying it out, don't hesitate to contact us.