We know that due to the Weierstrass approximation theorem any continuous function over a closed interval can be approximated by a polynomial of sufficiently high degree. Therefore, they are frequently used to approximate functions. We proposed a Lagrange polynomial‐based approach for solving the optimal control problem governed by the elliptic convection–diffusion partial differential equation. This paper solves it by the barycentric interpolation method as a class of strong‐form numerical methods. Thanks to Lagrangian multipliers, optimality system is derived and then the barycentric collocation method is employed to discretize the state variable and adjoint variable. Barycentric interpolation method is a Lagrange polynomial interpolation that is fast and deserves to be known as a method of polynomial interpolation. The convergence of the proposed method is also proved. At the end, numerical experiments are employed to illustrate the theoretical findings.