Change WordPress URL
Updated 5 days ago
If you need to move your WordPress installation, either because you have changed your site’s domain or because it needs to be moved to a different directory, WordPress makes the task easier by offering several options.
Change it from your settings
From the configuration options, under Settings > General, you can set and change the URL where your site is hosted.
This is possible as long as you can access your WordPress Dashboard.
If you cannot access your WordPress Admin, either because your site has already been moved or for any other reason, don't worry: you can enter these fields ("WordPress Address (URL)/Site Address (URL)") by manually editing the wp-config.php configuration file.
Set the new URL from wp-config.php
If you edit the wp-config.php file, available in your WordPress root directory, you can add the following code to set the value of these variables.
You must add the following code just above / That's all, stop editing! Happy blogging. */*
define( 'WP_HOME', 'http://midominio.com' );
define( 'WP_SITEURL', 'http://midominio.com' );Important: you must replace the part shown as "mydomain" in the example with the domain, including the directory, where you moved your WordPress installation.
Change URLs in the database
Finally, if your site content contains references to your old URL, you will need to edit them in the database.
There are plugins that make this task easier, and we recommend Better Search Replace for its simplicity and effectiveness.
Search for and install this plugin from Plugins > Add New, as shown in the screenshot below, and activate it once installed.
After installing and activating the plugin, look for the new "Better Search Replace" tool in the Tools section of your WordPress.
If your site is hosted with us, you can email us at [email protected], providing your WordPress access details, and we will take care of everything.