If you’re transferring your site from a development environment to a live or staging server, it is important to update the site URL settings before transferring the database to the new server. There are multiple ways to achieve this. Today we are going to be looking at how to update the site URL using phpMyAdmin. Before we get started we assume that you have access to cPanel through your hosting provider and know the name of the WordPress database you are trying to update.
Change the Site URL in the WordPress database.
- Navigate to phpMyAdmin from your hosting cPanel.
- Once you have selected the correct database for the site you which to change select the wp_options table.
- The first two tables should be siteurl and home. Select the Edit button for siteurl and then update the URL in the next step.
- Enter the new site URL in the table and select go to save the data. Be sure to replace ‘https://newsiteurl.com’ with your own domain name.
- Ensure the data has been updated. Repeat the process for the home table.
- Ensure both tables are updated correctly.
- That’s it! Your site URL and homepage should be updated in the WordPress database.
We have just walked through how to change the site URL and homepage directly in the WordPress database. There are also other ways to set this variable such as updating the wp-config.php file, running a SQL command to update the database, or making changes to your function.php file.
We will look at how to update these options in a future post. In the meantime, if you have any questions drop a comment below.