Reputation: 131
On my wordpress siteground staging copy all links including login page sends me to the live website. Wherever I click or try to login I get sent to the live website. Any idea what the issue could be?
Upvotes: 1
Views: 1875
Reputation: 183
Move wordpress websites, requires some steps.
1 - Change siteurl field in the table wp_options to or the follow code on your config file:
define('WP_SITEURL', 'http://www.new-domain.com');
define('WP_HOME', 'http://www.new-domain.com');
2 - Search and replace links from one site to another using SQL.
SELECT wp_posts.post_content FROM `wp_posts` WHERE wp_posts.post_content like '%http://www.old-domain.com/%'
UPDATE wp_posts set post_content = REPLACE(post_content,'http://www.old-domain.com/','http://www.new-domain.com/')
Moreover, the plugin WP Migrate DB is a good alternative. - https://wordpress.org/plugins/wp-migrate-db/
Finally. You should never forget perform a full website backup ( Including files and the MYSQL DB ) before start with the process.
Thanks. Regards, Ed.
Upvotes: 1
Reputation: 1166
Most probably your page URL setting in the database are set to live site.
Wordpress takes url settings from the database and if there is still live site url it will redirect you there, below you can see steps for changing URL.
wp_options
tablesiteurl
and home
to your stage server URLUpvotes: 1