Many strategies have been proposed for the control of wave energy converters (WECs). In order to evaluate these control strategies, they need to be optimised for realistic operating conditions. This paper develops a generic approach for WEC optimisation based on the use of Genetic Algorithms (GAs). Simulation results are presented for tuning an illustrative device in both sinusoidal and real waves; and for optimisation of both `slow tuning' and `latching' control systems. In contrast to conventional methods, the proposed GA successfully optimises the latching control algorithm for realistic seas without prior assumptions.