This tutorial will show you how you will change the old site URL with new site URL in WordPress. It is very easy job. Anyone can do this in 30 mins. Here is the steps for it:
Update wp-config.php file via FTP/CPanel
Connect to your server with FTP or CPanel. Download the wp-config.php file and add this two new lines into the file. Later upload the file on server.
1 2 |
define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com'); |
OR Changing the URL directly in the database
If you know how to access phpMyAdmin on your host, then you can edit these values directly to get you up and running again.
- Login to CPanel.
- Backup your database and save the copy off-site.
- Click on phpMyAdmin button.
- Click the link to your Databases.
- A list of your databases will appear. Choose the one that is your WordPress database.
- All the tables in your database will appear on the screen.
- From the list, look for wp_options. Note: The table prefix of wp_ may be different if you changed it when installing.
- Click on the small icon indicated as Browse.
- A screen will open with a list of the fields within the wp_options table.
- Under the field option_name, scroll down and look for siteurl.
- Click the Edit Field icon which usually is found at the far left at the beginning of the row.
- The Edit Field window will appear.
- In the input box for option_value, carefully change the URL information to the new address.
- Verify this is correct and click Go to save the information.
- You should be returned to your wp_options table.
- Look for the home field in the table and click Edit Field. Note There are several pages of tables inside wp_options. Look for the > symbol to page through them.
- In the input box for option_value, carefully change the URL information to the new address.
- Verify this is correct and click Go to save the information.
Now you can access the site with new URL. But I shall do another extra step. I shall replace all old URLs with new URL using Better Search Replace plugin.
After completion you will deactivate the plugin and remove it from server.
Leave a Reply