Changing Wordpress URL After Domain Change

When you move your Wordpress site over to a new domain usually changing the URL in the admin dashboard > Settings > WordPress Address (URL) and Site Address (URL) is enough.
But on some sites this does not always change all URLs and changing them in the database is needed.



Always make a backup before doing Mysql work!


In your cPanel go to PHPMyAdmin, once inside click on your Wordpress database, then click on the SQL tab. Here are some sample query, you need to change a few things to match your database.



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');




Make sure to change wp_ database prefix, change this to match yours.


Additionally there is a really handy tool here for generating the needed queries for you: Wordpress URL Change


This should effectively change over and URL that were missed by Wordpress when changing the URL in the dashboard. Once you are ready hit Go!


If this seems to much for you or you migrate a lot of sites and want something quicker and easier you can always try WP Migrate DB Pro


  • wordpress, change url, mysql database, phpmyadmin
  • 0 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

Improve Wordpress Performance With Litespeed LsCache

Litespeeds LScache for Wordpress outperforms every other Wordpress cache we have tested. Not only...

Running Out Of Disk Space What can I Do?

If you are running out of disk space and you are using Wordpress you can either add additional...

Migrating Wordpress Like A Pro With SSH

  Migrating your Wordpress site with SSH can streamline things, avoid some potential issues, and...

Installing VersionPress Plugin

VersionPress is an excellent way to version, sync, and stage Wordpress sites. VersionPress uses...

Wordpress admin-ajax.php CPU Use

The introduction of the Wordpress Heartbeat API has some advantages, and of couse disadvantages....