Change WordPress Site URL Via phpMyAdmin

Changing your WordPress site and home URL is an easy process that can be done via phpMyAdmin. There are many reasons why you might need to do this, but one of the most common ones would be changing the URL when you do not have access to the previous location or cannot currently access the WordPress admin area. Although this article assumes you are using cPanel, if you skip down to step 4 below, the directions should be the same regardless of how you access phpMyAdmin.

Important!

It is critical that you create a backup of your WordPress database before making changes. That way, if you make a mistake, you can restore your database and try again. You may want to check on the following article on how to backup your database: 

How to backup your mySQL database in cPanel

  • Look up the WordPress database name if you don't know it already. It can typically be found in the wp-config.php file where your WordPress site files are located. Look for a line like this, and your database name appears near the end of the line:
  • define('DB_NAME', 'your_db_name_here');
  • Log into the cPanel account for the domain in question. The URL to log into your cPanel account typically looks something like this (use your own domain name or use your new site's IP address rather than domain name): https://yourdomain.com/cpanel 
  • In the Databases section of cPanel, click on phpMyAdmin to open the database editing tool.
  • In the phpMyAdmin sidebar, find the options table in your WordPress database. To do that, you may need to click the + symbol next to your username and then locate the name of the database and click the + next to that. Finally select the options table itself by clicking on the actual text of the name (and not on the + like you did the others). This will load the table contents into the main part of this screen.
  • Often the name of the WordPress options table will be wp_options but it doesn't have to be. The letters and underscore character before the word "options" are known as the database prefix and the prefix could be anything at all or missing entirely. Just look for "options" in the table name and that is probably the correct one.
  • Look for the row with siteurl in the option_name column. It will probably be the first row, but if not, use the Filter rows: field above the table to locate it.
  • Click the Edit button at the beginning of the siteurl row so you can change the option_value.
  • Look for the large Value field in the option_value row. Don't change anything other than the URL listed in that box or you may break WordPress. 
  • Save your change if you're certain it is correct. Make sure Save and Go back to previous page are selected from the drop down menu items at the bottom of the screen and click the Go button.
  • Now we have to repeat the same steps for the home option.  Look for the row with home in the option_name column. It will probably be the second row, but if not, use the Filter rows: field above the table to locate it.
  • Click the Edit button at the beginning of the home row so you can change the option_value.
  • Look for the large Value field in the option_value row. Don't change anything other than the URL listed in that box or you may break WordPress. 
  • Save your change if you're certain it is correct. Make sure Save and Go back to previous page are selected from the drop down menu items at the bottom of the screen and click the Go button.
  • What is the difference between the siteurl value and the home value? The home value is URL you want people to enter into their browser's address bar to go to your site. The siteurl value is the URL where your WordPress installation is actually located.
  • In most cases both URLs should be exactly the same.
  • Test accessing your WordPress site from the new URL. Please note that you may need to update certain links in your site to properly reflect the new location. Thankfully, there is ⦁ at least one plugin that can help with this process.

 

Hjalp dette svar dig? 0 Kunder som kunne bruge dette svar (0 Stem)