Fix – WordPress Showing Localhost IP( for Comment Author Instead of Real


To fix this problem,

  1. Login to FTP/SFTP
  2. Go to public_html folder
  3. Edit wp-config.php
  4. Add below line
  5. Save Changes.
/** Required Code for showing correct IP address */
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { 
$xffaddrs = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']); 
$_SERVER['REMOTE_ADDR'] = $xffaddrs[0]; 

Mark: This common problem I had noticed on Cloudways web hosting. However, it is very optimized for better performance.

Subscribe our blog via Email
Get instant updates of our new blog post directly at your Mailbox.


  1. Chala March 27, 2017 Reply

Add a Comment

Your email address will not be published. Required fields are marked *

Please don't use SMS lang. By commenting on this article, you agree to our .