We employ a linear stability analysis and direct numerical simulations to study the characteristics of wall modes in thermal convection in a rectangular box under strong and inclined magnetic fields. The walls of the convection cell are electrically insulated. The stability analysis assumes periodicity in the spanwise direction perpendicular to the plane of a homogeneous magnetic field. Our study shows that for a fixed vertical magnetic field, the imposition of horizontal magnetic fields results in an increase of the critical Rayleigh number along with a decrease in the wavelength of the wall modes. The wall modes become tilted along the direction of the resulting magnetic fields and therefore extend further into the bulk as the horizontal magnetic field is increased. Once the modes localized on the opposite walls interact, the critical Rayleigh number decreases again and eventually drops below the value for onset with a purely vertical field. We find that for sufficiently strong horizontal magnetic fields, the steady wall modes occupy the entire bulk and therefore convection is no longer restricted to the sidewalls. The aforementioned results are confirmed by direct numerical simulations of the nonlinear evolution of magnetoconvection. The direct numerical simulation results also reveal that at least for large values of horizontal magnetic field, the wall-mode structures and the resulting heat transfer are dependent on the initial conditions.