Tutorial, Wordpress

Change WordPress PhpMyadmin URL

4 min read

WordPress PhpMyadmin URL.
WordPress uses MySQL database to store all data such as posts, pages, profiles and website configuration.
If you move your WordPress website to a different folder or domain, you will need to change the WordPress URL on some MySQL database tables.
Here is a guide on how to change WordPress URL via MySQL database in PhpMyAdmin.

What do you need?

Before starting the first step in this article, make sure that you:

  • Have access to the control panel of your hosting account
  • Understand the basics of phpMyAdmin

Step 1: Determine the Name of Your WordPress MySQL Database

You can skip this step if you only have one MySQL database.
However, if you have more than one database and are not sure which database is being used, please check first.

WordPress saves the name and details of the MySQL database in a file wp-config.php.
Please access the file wp-config.php in your WordPress directory.
To access it, you can use File Manager or FTP client.

how to change wordpress url

Open the file wp-config.php, right-click and select Edit and look for the line ‘DB_NAME‘.

change wordpress url

In this example, the MySQL database name is niagahos_wp702.

Step 2: Open phpMyAdmin

You can find phpMyAdmin in the Databases section of your hosting control panel.

php myadmin in cpanel

Step 3: Specify the Appropriate Database in wp-config.php

In the left menu section on phpMyAdmin, you can view the database for the website.
Please select the same database in the wp-config.php, in this example it is niagahos_wp702.

change blog url

Step 4: How to Change WordPress URL with SQL Query Formatting

Click the menu SQL at phpMyAdmin and enter the code below in the field provided.
Make sure the prefix table wp_ according to what you have, in this example the prefix table uses wpcr_.
You can see more details in the code below.

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

This code will replace all instances of urllama.com to urlbaru.com.
For example, if the WordPress address in the current table is urllama.com, will be changed to urlbaru.com.

[ecko_alert color=””gray””]IMPORTANT – Don’t forget to replace urllama.com with the previous WordPress website address and urlbaru.com with the new WordPress website address.[/ecko_alert]

wordpress url update

[ecko_alert color=””gray””]IMPORTANT – Sometimes the table prefix is different for each hosting service, and it doesn’t always use wp_.
If you get the message wp_options error, wp_posts, wp_postmeta could not be found, please check the prefix table again and update the SQL query code.
You can see the prefix table on the left side of phpMyAdmin, in the WordPress database: [/ecko_alert]

In this example, the prefix table uses wpcr_.

prefix table

Step 5: Run SQL Query

Once you have changed the URL and table prefix, you can run the query.
To run it, please click the GO on the bottom right.

click go

Step 6: Check the URL Changes in the Table

If the query has been successfully executed, you will see a green success message.

success message

The row number will be different for each WordPress website.

To check the changes, please open the table wp_options and line check home and siteurl.
You will see the new WordPress URL from the SQL query.

change wordpress url

If an error occurs and the query cannot be executed, double check the code for syntax errors and make sure you are using the correct prefix table.
If you are still experiencing errors, please contact the support staff of your hosting company.

Also Read: How to Create WordPress User Access Rights

Conclusion

By the end of this tutorial, you’ll know how to change a WordPress URL through a MySQL database using phpMyAdmin.
This way, you can easily change the URL when you need to change the domain name.
In addition, you can also find out the name of the database used for your WordPress website.

Hopefully, this article can help resolve your issue regarding the URL change.
Please click Subscribe to keep up with interesting articles about the online world sent directly to your email address. If you still have questions, don’t hesitate to share them in the comment section. 🙂

Source : https://www.niagahoster.co.id/


Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

× Chat