He will join Milton Keynes who will have to pay a transfer fee which will be set by a Football League tribunal.
O'Hanlon signed a new contract over the summer, but has now gone ahead and joined Milton Keynes anyway.
Milton Keynes like Swindon were relegated over the summer to League Two so he will now have to face Swindon again next season.