How to Efficiently Update WordPress URLs in Database

URLs are a vital component of WordPress, serving as live links and absolute paths for loading HTML, CSS, JS, images, and other static resources. Permalinks ensure that each page has a search-friendly URL for easy navigation. When migrating a website or changing domains, it’s crucial to update all URLs in the database to ensure proper functionality. Manual editing of the DB can be a challenging task, but fortunately, there are multiple ways to update WordPress URLs in database.

One popular option is to use a plugin such as Velvet Blues to update URLs, which allows you to quickly change all URLs in the database with just a few clicks. The plugin also provides a backup feature to restore the database if necessary.

Another method is to use a script like phpMyAdmin, which enables you to replace URLs in the database by specifying the old and new permalinks. Also allows you to test the changes before committing to them, which can be helpful.

Aside from these options, there are several other ways to replace URLs in the WordPress database, including using SQL queries or MySQL commands directly. However, these methods can be risky and should only be used if you’re comfortable with database management.

Check out other related articles, such as how to change WordPress theme name or common errors in WordPress.

How to Change WordPress Domain Name Using phpMyAdmin

To update your WordPress website’s URLs with the new domain name, you can use the following MySQL queries. If necessary, replace the table prefix ‘wp_’ with your own.

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

Just replace ‘’ with your website’s current address and ‘’ with the new address. If you see errors and the queries don’t run, check for code syntax errors and table prefix. If the error continues, contact your hosting support.

Change URL in Database Plugins

When it comes to updating domain URLs and internal links in WordPress, there are not many resources available in the marketplace. However, as I am web developer, come across 3 good plugins that provide a well-designed search and replace functionality for the database. With a user-friendly interface and easy-to-use navigation settings options. Let’s take a look at them.

1.) Better Search Replace By WP Engine

Better Search Replace

The ‘Better Search Replace’ plugin is a useful tool for updating old URLs with new ones in the WordPress database. It enables you to search and replace all instances of old permalinks with new ones without having to manually edit each entry. Also handle serialized data, which can be challenging to update. To use it, upload the plugin to the admin installer and run it after completing the migration process. Scan the database and replace all old links with new ones, ensuring that all links and data on your site are pointing to the correct location.

2.) Update URLs By KaizenCoders ( )

Update URLs

The Update URLs plugin by KaizenCoders is a useful WordPress tool for correcting broken URLs. Automates the process of updating permalinks, saving you time. Allows users to choose which links to update and displays the number of items updated. The extensions are helpful when moving to a new domain, as it helps update internal links and image references.

Also provides an option to update links for attachments. As well, as keeps track of the number of items updated.

3.) WP Migrate Lite By WP Engine ( )

WP Migrate Lite

WP Migrate is a powerful migration script designed for WordPress that simplifies the process of migrating databases and exporting full sites. Find and replace content directly within the dashboard panel and export the SQL. Import it into a new database as your need, using either this tool or phpMyAdmin. Moreover, automatically back up your database before running a find-and replace operation or on-demand. There are no alternatives to WP Migrate if you’re looking for an easy and useful migration plugin. Thanks to WP Engine, the fastest WP server provider, for making this possible.


After you have migrated your website, it is crucial to thoroughly test it to ensure that all the URLs are functioning correctly, regardless of the method you used. This will minimize any disturbances to your visitors and guarantee that your website is operating smoothly.

Inspire us with your love!

Saiful Islam

Saiful Islam, the founder of aThemeArt, is a successful freelancer, a father of two boys, and an enthusiast in coding, YouTube, and gaming. Connect with me on Twitter, Facebook, and Instagram to stay updated with my latest endeavors.

You can check also