In this paper, we designed two different configurations with locally isothermal sidewalls, where the temperature is set to be the bulk temperature, to control the large-scale circulation in turbulent Rayleigh–Bénard convection, namely two-point control and four-point control. At fixed Rayleigh number $Ra=10^8$ and Prandtl number $Pr=2$, a series of direct numerical simulations are performed on both two-dimensional (2-D) and quasi-two-dimensional (quasi-2-D) cavities with both types of control, where the width of the control area is fixed at $\delta _c=0.05$ and the vertical distance from the cavity centre $h_c$ varies from 0 to 0.45 with an interval of 0.05. Our results show that the control effect depends on $h_c$, the control configurations as well as the flow dimensions. For 2-D cavities, both two-point control and four-point control suppress the flow reversal when $h_c \geq 0.05$, accompanied by the enhancement of vertical heat transfer and the strength of the large-scale circulation. For quasi-2-D cavities, the suppression of the flow reversals is obvious with two-point control and $h_c\geq 0.05$, while the effect is rather limited with four-point control. Further experiments with $Pr=5.7$ and $Ra$ up to $7.36\times10^8$ show that two-point control with $h_c=0.15$ can effectively suppress the flow reversal, while two-point control with $h_c=0$ can suppress the reversals at low $Ra=1.93\times 10^8$ and activate them at higher $Ra=7.36\times 10^8$, which agrees well with our numerical simulations.