WordPress – All the IP Addresses of Comments are Same and of Local Server
![WordPress – All the IP Addresses of Comments are Same and of Local Server WordPress – All the IP Addresses of Comments are Same and of Local Server](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgAzOmmgBcqYdx_-rxFw8VtbDMABCHExD7TsAFTB_YIllfB3jz2mhC3OeXY-bcR6358U7zVsZy-9WqUG-QuPctFURFAoG76-6eil-NSwx4FVZHxTROI0hplLQeyxZZo99FMm4L3r5BaI4/s400/wpcomments-800x176.png)
Recently I started to notice that after some updates on platform, all the comments on the blog posts have exactly the same IP Address. This started to create a major problem for me. As most of you know malicious attacks and spamming is a common problem everywhere. This blog also receives lots of spam messages and it is very important that spams are filtered out so I can respond to all the valid comments.
However, now all the comments contain the same IP address and that also of the my server’s IP address, it was very difficult for the spam catcher plugin to catch all the spams. After reading through quite a many spam comments, I decided to fix this problem for good.
Here is the solution I applied.
I went to php.config which is in the root folder of public_html and added following lines in the code.
1 2 | if ( $_SERVER [ 'HTTP_X_REAL_IP' ]){ $_SERVER [ 'REMOTE_ADDR' ] = $_SERVER [ 'HTTP_X_REAL_IP' ];} |
Once I applied to above mentioned line, everything was back to normal. All the comments in the WordPress, started to show the IP address of the original individuals.
Well, that’s it. A very simple solution to a complicated problem.