Try this in your MySQL-database:
Open your MySQL-database, choose the wordpress database on the left side by clicking on it (normally it’s name is “wordpress”). Then in the main content area you see a tab that says: “SQL”. Click on that and you’ll see a text area for SQL-commands. There you paste in:
UPDATE wp_posts SET post_content =
replace(post_content, 'www.old-domain.org', 'www.new-domain.org');
Needless to say that you have to replace the “'www.old-domain.org'
” with your old – and the “'www.new-domain.org'
” with your new Site-URL…
You can write whatever domain in there. So it could also be like this:
UPDATE wp_posts SET post_content =
replace(post_content, 'www.yoursite.org/old-structure', 'www.yoursite.org/new-structure');
The important thing is, that you only put those parts of the URL in there, that you actually want to change. You can also leave the “www” away, but this, too, is a change (e. g. “www.old-domain.org” –> “new-domain.org”)
BUT PLEASE NOTE!!!
This is an irreversible command!
So you better use a search engine before you do that in order to know how to backup your SQL-database in the first place!
Maybe you experience the problem that I first had with this method:
I got updated URLs afterwards that looked like this:
new.domain.org/new-domain.org/...
In this case, paste the whole SQL-command again, but this time, the former “old-domain” is now the new one (the first in the URL-doubling) and you’ll have to leave the new-domain URL (which is the second of the doubling) blank. Example:
UPDATE wp_posts SET post_content =
replace(post_content, 'new-domain.org', '');
By leaving the second URL empty, the domain mentioned before (“new-domain.org” gets deleted – and tadaaaa: the double-domain URL is fixed.
kind regards,
Romanowitsch