1

I copied my site: www.old_site.com

to a new address: www.new_site.com

All links in new_site point to the old site.

What do I have to change so that new site points to new site? Thank you.

2

What web addresses are in your Dashboard > Settings > general? if it is the old site, try changing it, if changing is impossible, try putting the following code at the top op wp-config.php:

define('WP_HOME','http://www.new_site.com');
define('WP_SITEURL','http://www.new_site.com');

Are the site urls correct? Try searching your page template and see if you have still some old links in there. You can replace the old url from links from the old site with by :

<?php bloginfo('siteurl'); ?>

7
  • Strangely this does not change anything. Should I restart something? Thank you. – p.a. Jan 15 '14 at 13:47
  • I cannot access my admin module, it redirects to the old! Thanks – p.a. Jan 15 '14 at 13:48
  • The rason you cannot login in the new url is indeed because your site still has the old url as siteurl and homeurl. Did you paste the code for wp-config in the php tags? did you refresh the page and clear the cache? – Maartje Jan 15 '14 at 13:59
  • The problem can also be in your database. Go to your database > table wp_options You will see that the first record is the siteurl, is this you old or new one? Also, look at the 36th record for your home url – Maartje Jan 15 '14 at 14:03
  • Thanks but how can I go to the database without accessing my site? even my admin? I added the directives in wp-config and even in functions.php but to no avail What do you mean "did you refresh the page". What page? – p.a. Jan 15 '14 at 23:27
2

Please refer to this link
http://codex.wordpress.org/Changing_The_Site_URL
It is possible to set the site URL manually in the wp-config.php file.

Add these two lines to your wp-config.php, where "example.com" is the correct location of your site.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
2
  • Strangely this does not change anything. Should I restart something? Thank you. – p.a. Jan 15 '14 at 13:46
  • Thank you, adding in wp-config.php did it. I was not able to write in this file because the new site files did not have write attributes and I did not notice. Now I write in this and all is OK. Thank you! – p.a. Jan 18 '14 at 7:23
0

Use this plugin for change old domain to new domain name.

2
  • Even my login and "site admin" links point to the old site, I dont think this is my case. Thanks. – p.a. Jan 15 '14 at 13:48
  • Yes! Use old site first you can install this plugin then migrate to new domain. – Shafi Zahid Jan 15 '14 at 15:24
0

If you're still having issues with this and you've changed the URL in the wp-config file, it could be that your database has posts pointing to the old URL. The tool I use, when migrating a WordPress installation, is dbreplace2.

You'll go to the link, download the php file, upload it to your server via FTP, and then go to the appropriate URL of that file in your browser. USE CAUTION WITH THIS FILE! That cannot be stressed enough. You'll basically follow the instructions of the file and enter your old URL into a field and a the new URL into another field and it will go into the DB and replace all of the instances of the old, with the new. Make sure everything is entered correctly or you'll have a huge headache on your hands. Also, be sure to remove the file from the server once you're complete as it has access to your DB directly.

1
  • Thank you, adding in wp-config.php did it. I was not able to write in this file because the new site files did not have write attributes and I did not notice. Now I write in this and all is OK. Thank you! – p.a. Jan 18 '14 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.