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?
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.
public_html
then that means you also copied over thewp-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 thewp-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 thewp-content
folder. – Tony Djukic Dec 31 '20 at 19:53