Or so they claim, but at least three British territories still had slavery into the 20th Century (British East Africa, Tanzania & Hong Kong).
There also was slavery in German Tanganyika when the Paris Peace Conference ceded the territory to Britain in 1919, but that was none of the Brit's fault.
So deeply ingrained in those local cultures the Brits didn’t have the manpower to enforce it even they wanted to! Best that could be done is try and contain it.