© 2021 Elsevier Masson SASOptimal control of the unsteady, laminar, fully developed flow of a viscous, incompressible and electrically conducting fluid is considered under the effect of a time varying magnetic field B0(t) applied in the direction making an angle with the y–axis. Thus, the coefficients of convection terms in the Magnetohydrodynamics (MHD) equations are also time-dependent. The coupled time-dependent MHD equations are solved by using the mixed finite element method (FEM) in space and the implicit Euler scheme in time. FEM solutions are obtained for various values of the Hartmann number, Reynolds number, magnetic Reynolds number and for several types of time dependence of applied magnetic field at transient level and steady-state. In this study, we aim to control the unsteady MHD flow by using the time varying coefficient function f(t) in the applied magnetic field B0(t)=B0f(t) as a control function. In addition, control problem is designed to involve the determination of the optimal parameters of the system (Reynolds number, magnetic Reynolds number and the angle θ) regarded as control variables. In the optimization, a discretize-then-optimize approach with a gradient based algorithm is followed. Cost function is designed to regain the prescribed velocity and induced magnetic field profiles as well as the smooth control function with respect to time. Controls are investigated for the regularization parameters included in the cost function. Optimal solutions are achieved for several states of the flow considering Hartmann number and at the time level where the flow stabilizes.