From 1a3a873086f6eaddf5eb7e79c52c88824234e7ae Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Wed, 26 Jul 2017 20:31:12 +0200 Subject: [PATCH] Always serve robots.txt --- includes/functions.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index 329a555..9a44197 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -71,6 +71,12 @@ function fx_private_site_please_log_in() { /* Hook */ do_action( 'fx_private_site_before_auth_redirect' ); + /* Always allow access to /robots.txt to allow search engine indexing management. */ + global $wp; + if ( $wp->request === 'robots.txt' ) { + return; + } + /* If using BuddyPress and on the register page, don't do anything. */ if ( function_exists( 'bp_is_activation_page' ) && bp_is_activation_page() ){ return;