1//Add at the top of wp-config.php
2
3$temp_ip = explode(',', isset($_SERVER['HTTP_X_FORWARDED_FOR'])
4? $_SERVER['HTTP_X_FORWARDED_FOR'] :
5(isset($_SERVER['HTTP_CLIENT_IP']) ?
6$_SERVER['HTTP_CLIENT_IP'] : $_SERVER['REMOTE_ADDR']));
7$remote_addr = trim($temp_ip[0]);
8$_SERVER['REMOTE_ADDR'] = preg_replace('/[^0-9.:]/', '', $remote_addr );
9