You have to block UK visitors only (that's to satisfy Ofcom).
To check visitor's geo, it depends on your stack (PHP, ...).
You can ask your hosting provider. If you have Cloudflare it injects a header with a country code : CF-IPCountry
UK country code is GB.
__________________
|