Changing the website URL of your WordPress website using phpMyAdmin database

If you have moved your website from one domain to another or changed your primary domain on your account, you need to ensure that it is the new domain/URL that is used in your WordPress installation.

Here is a guide that shows you how to change your site URL / web address in WordPress via the phpMyAdmin database.

Find the Name of the WordPress MySQL Database

Skip this part if you only have one MySQL database. But if you have multiple databases and are unsure which one is connected to your WordPress, then follow the steps below.
WordPress stores MySQL database names and their login information in the wp-config.php file. You can find this file in your root folder where WordPress is installed:

  • Log in to cPanel and open File Manager.
  • Select the folder with the domain name if it is an addon domain and "public_html" if it is your main domain
  • Open the wp-config.php file and search for DB_NAME. The value of this parameter is the name of your database.

 

Change URL in the Database

To change WordPress URLs in your MySQL database, follow these steps:

1. Go to phpMyAdmin via your cPanel control panel.

2. Select the database connected to your WordPress site and go to the SQL tab.

3. Enter/copy the SQL query below to replace the old URL with the new one in the tables wp_options, wp_posts, and wp_postmeta.

UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = replace(guid, 'oldurl.com','newurl.dk'); UPDATE wp_posts SET post_content = replace(post_content, 'oldurl.dk', 'newurl.dk'); UPDATE wp_postmeta SET meta_value = replace(meta_value,'oldurl.dk','newurl.dk');

4. Replace 'oldurl.com' with your current WordPress address and 'newurl.com' with your new WordPress address.

5. Remember to check if your table prefix is different from the standard 'wp_' and update the SQL query accordingly.

6. Press 'Go', and you will see success messages as well as the number of changed rows.

7. Finally, verify the changes by opening the wp_options table and checking the value of siteurl and home.

If you experience error messages or the SQL queries do not execute, check your code for syntax errors and ensure that you are using the correct table prefix. Contact hosting support for further assistance if the error continues.

  • 0 Users Found This Useful
Was this answer helpful?

Didn't find a solution?

If you haven't found a solution by searching or navigating our categories, you can open a new support ticket.

Open New Ticket

Related Articles

Upload files with FTP

If you need to manually download or upload files to your web hosting, you can do it using an FTP...

How to find your web hosting details

You can find the essential web hosting details in the welcome email you received when you created...

Where do I find FTP information?

If you are missing your FTP information, you can find it in two places. Log into your...

How to create a database and a database user

In the video below, we demonstrate how you can quickly and easily create a database and a...

Common errors (and solutions) during FileZilla file uploads

In this guide, we will go through a series of common errors you might encounter when uploading...