I was developing a new WordPress website so i added this function at the end of the "functions.php" file to redirect all users to a /maintenance-mode page in my website except me(My IP-Address):
function wp_maintenance_mode() {
if ( !is_page( 2075 ) && $_SERVER['REMOTE_ADDR'] != "111.222.33.44" ) {
wp_redirect( home_url( 'maintenance-mode' ) );
exit;
}
}
add_action( 'template_redirect', 'wp_maintenance_mode' );
After finishing the website development and i wanted to put it alive i have commented this function by putting it inside comments /* */ .. When i now access the website strangely the maintenance-mode still appears when i access any page. I tried to remove the comments but it still goes to the maintenance-mode page!
It is getting me crazy and i can't find why this happens. I searched everywhere, in the database, in my files for an access to the maintenance-mode page but i can't see any.
Do you have any idea what may be causing this?