WordPress on localhost still points to the live site

I have tried copying my wordpress site to my PC for editing offline using WAMP. I followed the following tutorial word for word.

How to create a local copy of a wordpress site

I have placed my files in C:\wamp\www\wordpress

I saw somewhere about adding the following to the wp-config.php but it still points to my website.

define('WP_HOME','http://localhost/wordpress');
define('WP_SITEURL','http://localhost/wordpress');

I am 100% sure that wp_options table in my database only references http://localhost/wordpress so where is it getting my live site address from?

UPDATE 1:
I just noticed the following in the bottom of my wp-config.php

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 */
 define('WP_DEBUG', false);

 define('WP_ALLOW_MULTISITE', true);
 define( 'MULTISITE', true );
 define( 'SUBDOMAIN_INSTALL', false );
 $base="https://wordpress.stackexchange.com/";
 define( 'DOMAIN_CURRENT_SITE', 'www.mywebsite.co.uk' );
 define( 'PATH_CURRENT_SITE', "https://wordpress.stackexchange.com/" );
 define( 'SITE_ID_CURRENT_SITE', 1 );
 define( 'BLOG_ID_CURRENT_SITE', 1 );

 /* That's all, stop editing! Happy blogging. */

 /** Absolute path to the WordPress directory. */
 if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . "https://wordpress.stackexchange.com/");

 /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

where it says

define( 'DOMAIN_CURRENT_SITE', 'www.mywebsite.co.uk' );

(obviously changed my address for posting) if I change it too

define( 'DOMAIN_CURRENT_SITE', 'localhost/wordpress' );

I get a redirect loop. Is this related or am I changing something I don’t need to and the issue is else where?

UPDATE 2: does it having anything to do with the fact that on my website the wordpress files are in the www folder and on the local they are in the www/wordpress folder?

6 Answers
6

I have found the answer… well to my situation anyway. It was something related to multisite. Removing the following from wp-config.php got it to work for me.

Removed

define('WP_ALLOW_MULTISITE', true);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base="https://wordpress.stackexchange.com/";
define( 'DOMAIN_CURRENT_SITE', 'www.mywebsite.co.uk' );
define( 'PATH_CURRENT_SITE', "https://wordpress.stackexchange.com/" );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

Although I had mine setup for multisite I wasn’t really using it so I thought I would try and set it up as single site. As soon as I tried the above it worked.

Leave a Comment