Crossword Genius

Upright judge replaced by king in purge (5)

Ross

I believe the answer is:

erect

I'm a little stuck... Click here to teach me more about this clue!

'upright' is the definition.
(I know that upright can be written as erect)

'judge replaced by king in purge' is the wordplay.
I cannot really understand how this works, but
'king' could be 'er' (abbreviation for Edward Rex, various English kings) and 'er' is found within the answer.
The remaining letters 'ect' is a valid word which might be clued in a way I don't understand.
This explanation may well be incorrect...

Can you help me to learn more?

(Other definitions for erect that I've seen before include "Found" , "Upright; put up" , "Assemble" , "Upright or vertical" , "Unbowed" .)

I've seen this clue in The Independent.
Want a hint initially instead of a full solution? Install my app