Unspeakable
Unspeakable

Reputation: 247

Wordpress: WP admin not reflecting changes

I tried to duplicate the main site and created a folder for the copied one in my cpanel. Then I deleted the wp_config.php file of the copied then on setup for the copied one I set the database details same as the main site and still set the prefix table to 'wp_' which is also the same as the main site.

Now that I've did that, I got logged in the wp admin but the url is the same as the main site, "main_url/wp-admin". Then when I logged out and went to the copied one which is like this main_url/copied_one_folder_name/wp-admin I get redirected to some url and trying to log in but I can't.

But I can still log in using the main_url/wp-admin but then making changes there doesn't reflect the main site anymore. Is it because I've used the same db and somehow the one controlling the db is now the copied one? How do I fix this? Please help.

Upvotes: 2

Views: 339

Answers (1)

Helping Hands
Helping Hands

Reputation: 5396

Kindly change your Main URL to New URL in database using following query :

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

Above will solve your issue. Remember same database do not change URL as per new location when you import. So it is require to change all URLs using UPDATE SQL Query.

So In your case http://www.oldurl will be main_url & http://www.newurl will be main_url/copied_one_folder_name

Upvotes: 1

Related Questions