Tips / Recommendations

SQL queries to transfer a WordPress site to another domain

Describing SQL Queries

In general, there are three main requests (there is a fourth request in the screenshot, but about it a little later). So, is the old domain, is the new one.

WordPress database table names are prefixed. By default, this is wp_, but on your site the prefix can be absolutely anything, for example, your wp_posts table may be called omw_posts or qwertyposts, keep that in mind.


UPDATE wp_options SET option_value = REPLACE (option_value, ‘’, ‘’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
UPDATE wp_posts SET post_content = REPLACE (post_content, ‘’, ‘’);
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, ‘’,’’);