I copied my site to another site but all links point to old site

I copied my site:
www.old_site.com

to a new address:
www.new_site.com

Read More

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.

Related posts

4 comments

  1. 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'); ?>

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

Comments are closed.