Free ToolWordPress Domain Migration SQL Generator
How to Use This Tool

Enter your domains
Enter the old domain (where your WordPress is currently hosted) and the new domain (where you’re migrating to). Include the full URL with protocol (http:// or https://).

Set your database prefix
The default WordPress prefix is wp_. If you changed it during installation, enter your custom prefix. You can find it in your wp-config.php file.

Generate & run queries
Click “Generate Queries” and then run the SQL queries in your database using phpMyAdmin, MySQL CLI, or any database management tool. Always back up your database before running these queries.
⚠ Important Notes
- Always backup your database before running any migration queries.
- These queries handle standard WordPress tables. Some plugins may store URLs in custom tables not covered here.
- Serialized data (used by many plugins/themes) may not be correctly updated by simple SQL REPLACE. Consider using
WP-CLI search-replacefor serialized data. - After running the queries, clear all caches (plugin caches, CDN, browser cache).
- Update your
wp-config.phpif it contains hardcoded URLs.
WordPress Multisite
For multisite networks, you’ll need to run the queries for each subsite separately using their specific prefix (e.g., wp_2_, wp_3_). Additionally, you’ll need to manually update the wp_blogs, wp_site, and wp_sitemeta tables.
