• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Query to remove ip address from all users?

Brent W

Well-known member
#1
While setting up RailGun we briefly had it live where it wasn't forwarding the users ip address but instead our servers ip address. This means that many members show up as sharing our servers ip address. How can I delete that IP address from all users accounts?
 

Mike

XenForo developer
Staff member
#2
Code:
DELETE FROM xf_ip WHERE ip = UNHEX(LPAD(HEX(INET_ATON('1.2.3.4')), 8, '0'));
Change 1.2.3.4 as needed.

I haven't tested this yet, so I'd recommend using the SELECT version to confirm it's grabbing what you expect and, as usual, I'd recommend backing up before running this.
 

Brent W

Well-known member
#3
Code:
DELETE FROM xf_ip WHERE ip = UNHEX(LPAD(HEX(INET_ATON('1.2.3.4')), 8, '0'));
Change 1.2.3.4 as needed.

I haven't tested this yet, so I'd recommend using the SELECT version to confirm it's grabbing what you expect and, as usual, I'd recommend backing up before running this.
Worked perfectly.