--- title: "How to Unban a Player (banned Files, In-Game, and SQL)" excerpt: "The three places a CS 1.6 ban lives, the removeid/removeip and writeid/writeip commands that actually delete it, the AMXX amx_unban limits, and how SQL-based bans differ." category: "administration" tags: "bans, admin" image: "" read_time: "8 min read" ---
Removing a ban is fiddly because a ban can live in three different places, and clearing it from one does not touch the others. A player still blocked after you "unbanned" them is almost always banned somewhere you did not look. This covers the engine ban list, AMX Mod X commands, and database-backed bans, with the exact commands that remove each and persist the change.
There are three independent systems:
banid, saved to the id ban file with writeid.addip, saved to the ip ban file with writeip.List the engine bans first so you know what you are dealing with:
listid listip
listid prints every banned SteamID; listip every banned IP. If the player's ID or IP is not in either list, the ban is a plugin/SQL ban and the engine commands below will not help.
Two steps, and the second is the one people skip:
removeid STEAM_0:1:12345678 writeid
removeid drops the ban from the running server's memory; writeid rewrites the id ban file (commonly banned_user.cfg, or banned.cfg on older builds) so the removal survives a restart. Skip writeid and the ban comes back on the next map change or reboot, because the file still lists it and is re-read at startup. You can also removeid by the ban's slot number shown in listid.
The IP equivalents, same two-step pattern:
removeip 203.0.113.45 writeip
writeip saves the IP list (commonly listip.cfg or banned_ip.cfg). IP bans are blunt — they can catch a whole household or an ISP CGNAT pool — so if you are unbanning because you hit an innocent bystander, prefer SteamID bans in future. Note the engine can also short-circuit IP bans with sv_filterban; that cvar decides whether the list blocks or allows, so an unexpected ban behaviour can trace back to it.
From in-game as an admin, AMX Mod X exposes an unban command:
amx_unban 203.0.113.45
Be aware of a real limitation: amx_unban in the stock admin plugin operates on IP bans and runs removeip/writeip for you. It does not reliably clear a SteamID ban — for that you still use the console removeid + writeid above, or a ban-manager plugin that wraps SteamID unbanning in a menu. A maintained suite such as the CSB Ban Manager or the CSB Admin Menu gives you a searchable ban list and a one-click unban so you do not fat-finger a raw command.
If you run a database-backed ban system (the common AMXBans-style setup), the ban lives in a MySQL table, not in the engine files, and the engine removeid will not touch it. Unban through that system's own tool — its web panel, its in-game menu, or a direct DELETE on the bans table keyed by SteamID. Clearing the engine list and leaving the SQL row is the number-one reason a "removed" ban re-applies the moment the plugin re-syncs its bans back into the engine on the next map.
removeid/removeip without writeid/writeip. The file still holds the ban and is re-read at boot.amx_unban "worked" but they are still banned — it cleared an IP ban but the block is a SteamID ban. Use console removeid + writeid.removeid says no such ban — wrong ID format or the ban is only an IP ban. Check listid and listip for the exact entry.listip before and after.After unbanning, list the relevant table and confirm the entry is gone:
listid listip
Then restart the server and run them again — if the entry is still absent, your writeid/writeip (or database delete) stuck and the unban is permanent. Have the player reconnect to confirm. If they still cannot join, the ban lives in a system you have not cleared yet; work through all three sources above. To ban correctly in the first place, see finding a SteamID and banning with persistence.