skip to Main Content

I uploaded live site backup on localhost to make some major changes in my theme, but I’m having an issue. my front page is loading fine and I can also login to wordpress dashboard, but whenever I click on any post, categories or any other page link it redirects me to ‘localhost/dashboard’. I already change the links ‘oldsite.com’ to ‘localhost/site_name’ for wp_posts, wp_postmeta and wp_option from the database and it’s also showing the localhost link correctly. but it’s not redirecting to that link.

Any suggestions or fix!?

Thanks!

2

Answers


  1. Try this wpbeginner tutorial


    You probably forgot to change all needed records in database.

    UPDATE wp_options SET option_value = replace(option_value, 'https://www.example.com', 'http://localhost/mylocalsite') WHERE option_name = 'home' OR option_name = 'siteurl';
    
    UPDATE wp_posts SET post_content = replace(post_content, 'https://www.example.com', 'http://localhost/mylocalsite');
      
    UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://www.example.com','http://localhost/mylocalsite');
    

    There is a risk that you must update reverse proxy configuration (apache) to point to your website, but upper solution should work. If it didn’t work and you cannot reach your website, please give feedback, someone should help you.

    Login or Signup to reply.
  2. you can also use Better Find and Replace plugin (https://wordpress.org/plugins/real-time-auto-find-and-replace/).if you don’t know much coding .if you know coding you can export database and open the file with editor just use find and replace command and save file and import database again.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search