Wordpress - WordPress localhost site redirect to live site

According to the wordpress reference here

Add these two lines to your wp-config.php, where "example.com" is the correct location of your site.

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

OR

Edit functions.php

Add these two lines to the file, immediately after the initial "

update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );

Or check the .htaccess file as well if added any rewrite rule for redirect the website.

Hope this help!!


Try following

  • If there are caching plugins installed like W3 total cache. Then purge cache first. Or may be disable them for time being

  • Perform Search and Replace in the database for Old Site URL. You can Use this Plugin

  • Reset Permalinks ( Dashboard >> Settings >> Permalinks )

  • Last but not the least. Clear your browser Cache and History

    • In Chrome, you can try to clear your DNS cache before clearing all your cache

Tags:

Redirect