In this paper, a fundamental theoretical framework of a control strategy is presented for wave energy converters (WECs) in a closed-loop configuration. The problem is translated to the optimal control, based on the Hamilton-Jacobi-Bellman (HJB) theory that some generalized semi-quadratic value functions are used as the stage cost within the performance index. The performance index is introduced as much as possible in the general quadratic form based on a non-integer order integral of the Riemann-Liouville form whose kernel plays as a tuning factor of the resultant optimal controller. Optimizing several compromising requirements in the presence of penalty on the final situation of the WEC is our main effort during which, based on the optimal control theory, a set of rigorous mathematical conditions have been derived for the optimal control law. Moreover, exploiting the capability of the non-integer order integrals, a time-dependent kernel has been involved in the stage cost which can be considered as a natural forgetting factor. A one-body and a two-body heaving point absorber WECs connected to a power take-off (PTO) are considered in order to validate the control strategy in irregular waves. Moreover, the performance of considered one-body WEC with and without the presence of the proposed optimal control strategy is assessed at eight hot spot locations of the Persian Gulf, based on the approximately 20-year (January 2000–May 2019) of the ERA5 reanalysis wave data set.