0

Hello I am new to wordpress, our website was down (due to plugin update) I was not even able to access the admin panel due to this, so I went to the directory and copied from our staging directory (the only working directory) to the public_html directory (Production Directory). This did fix access to the website but now when I access the website the home page is referencing the correct directory (non staging) but when I navigate to any tabs I am re-routed to the staging site (staging directory) which I do not want. Does anyone know how to fix this in order to stop the public html from redirecting to the staging html?

2
  • 1
    If you copied over all the files from staging's public_html then that means you also copied over the wp-config.php file. That files tells WordPress which database to use. So when you first load the site, it's loading WP because that's what's in the root directory (public_html). You have to either get the wp-config.php from a back-up of the live site and replace that, or you have to edit the file so that it connects to the right database: wordpress.org/support/article/editing-wp-config-php Next time, only copy over the wp-content folder. – Tony Djukic Dec 31 '20 at 19:53
  • 1
    Thank you very much, this did seem to be the issue! – Chris o Jan 1 at 21:48
1

Check your production site's wp-config.php file for one or both of these lines:

define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );

...and set them as appropriate if they exist.

These constants will override the settings in the database if they're present. See Editing wp-config.php for details.

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.