WordPress only takes the VPS IP

Catamarca Web
  • CMS & No-code
  • Web Development
  • SEO & GEO
  • Entrepreneurship
Eager newcomer Level 3
Posts
5
Like
0
Since
2018
Automatically translated from Spanish
Author #1

Good morning to the community, I'd like to share my concern, I have a WordPress on a VPS and I've noticed that when receiving comments on WordPress they all belong to the same IP (the VPS's) and not the user's. Is there any way to fix this? Thanks

Automatically translated from Spanish

1 replies

  1. Catamarca Web
    • CMS & No-code
    • Web Development
    • SEO & GEO
    • Entrepreneurship
    Eager newcomer Level 3
    Posts
    5
    Like
    0
    Since
    2018
    Automatically translated from Spanish
    Author #2

    I've solved it by adding these two lines

    if($_SERVER['HTTP_X_REAL_IP']){
    $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_REAL_IP'];}
    
    Automatically translated from Spanish

Sign in to take part in the forum.

This reply will be hidden. It is kept and can be restored.

Reason
or with your email