New Check out the curated list of the finest design resources I've gathered for you! Take a look →

How to Change WordPress URL in Database

Are you looking to change the URL of your WordPress website in the database? Whether you are moving your website to a new domain or just want to change the domain structure, it is important to update the URL in the database to ensure your website functions properly. In this step-by-step guide, we will walk you through the process of changing WordPress URL in the database.

Step by Step Guide

1. Access your database:

  • Log in to your hosting account.
  • Look for the database management tool (e.g., phpMyAdmin).
  • Open the tool to access the database.

2. Locate the wp_options table:

  • In the left sidebar of the database management tool, click on your WordPress database.
  • Find the table named wp_options (or similar) and click on it.

3. Backup the database:

  • Before making any changes, it is essential to create a backup of your database.
  • Look for the Export option in the database management tool to export the current database as a backup.

4. Update site URL values:

  • Once you are in the wp_options table, locate the rows with the option_name values “siteurl” and “home”.
  • Click on the edit button (pencil icon) next to each row.
  • In the option_value field, replace the existing URL with the new URL.
  • Click on the Save button to apply the changes.

5. Update URL in database:

  • Now, you need to update the URLs in other tables that store your website content (e.g., posts, pages, menus).
  • Use the Search and Replace plugin or a similar tool to search for the old URL and replace it with the new URL in all relevant tables.
  • Follow the instructions provided by the plugin/tool to perform the search and replace operation.

6. Test your website:

  • After updating the URLs, it is crucial to test your website to ensure everything is working as expected.
  • Try accessing different pages, menus, and media files to check if they are loading correctly.
  • If any issues arise, double-check the changes you made or restore the database backup.


In this guide, we explained how to change the WordPress URL in the database. By following these step-by-step instructions, you can ensure that your website functions smoothly after changing the URL. Remember to create a backup before making any changes and test your website to verify its functionality. Enjoy your newly updated website!

Please note that this guide assumes you have basic knowledge of accessing and managing your WordPress database. If you are not familiar with this process, it is recommended to seek assistance from a professional or your hosting provider.

Rizwan Aritonang

An independent WordPress & Front-End Developer from Bandung, Indonesia.

Get In Touch

Leave a Comment