How Do I Make My Whole WordPress Site Private?

There are a number of ways to make your WordPress site private. You can use a plugin like Disable Login Attempts, or you can edit the wp-config.php file and add the following code:

define( ‘WP_HOME’, ‘/usr/local/WordPress’);
define( ‘WP_SITEURL’, ‘http://localhost/’);
define( ‘WP_CONTENT_DIR’, ‘/usr/share/WordPress’);
define( ‘WP_CONTENT_URL’, ‘http://localhost/’);
define( ‘WP_CACHE_DIR’, ‘/usr/share/WordPress/wp-cache’);
define( ‘WP_DEBUG’, true);
define( ‘WP_ADMIN’, ‘http://localhost/’);
define( ‘WP_MAX_CONTENT_LENGTH’, ‘10000’);
define( ‘WP_USER_DIR’, ‘/usr/share/WordPress/users’);
define( ‘WP_USE_WPLANG’, false);

The first line defines the root WordPress directory. The second line sets the WordPress site URL. The third line defines where WordPress will store the cache files. The fourth line defines the WordPress debug mode.

The fifth line sets the WordPress admin area URL. The sixth line defines the maximum length of a WordPress post. The seventh line defines the WordPress user area URL. The eighth line defines whether WordPress should use the wplang language file.