Change WordPress URL
Updated 2 months ago
If you need to move your WordPress site, whether because you’ve changed your website’s domain or need to move it to a different directory, WordPress makes it easy with several available options.
Change it in your settings
In Settings > General, you can set and change the URL where your site is hosted.
This is only possible if you can access your WordPress dashboard.
If you can’t access your WordPress admin, whether 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 in wp-config.php
If you edit the wp-config.php file, located in your WordPress root directory, you can add the following code to set the values 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' );Note: replace "mydomain" in the example with the domain and directory where you moved your WordPress site.
Change URLs in the database
Finally, if your site’s content contains references to your old URL, you’ll 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.
Find 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, find 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] with your WordPress login details, and we’ll take care of everything.