A new approach is presented for the boundary optimal control of the MHD equations in which the boundary control problem is transformed into an extended distributed control problem. This can be achieved by considering boundary controls in the form of lifting functions which extend from the boundary into the interior. The optimal solution is then sought by exploring all possible extended functions. This approach gives robustness to the boundary control algorithm which can be solved by standard distributed control techniques over the interior of the domain.