Buoyancy-driven, incompressible, two-dimensional flow of a micropolar fluid inside an inclined porous cavity in the presence of magnetic field is investigated. The nonlinear partial differential equations are solved by employing a robust Galerkin finite element scheme. The pressure term in this scheme is eliminated by using the penalty method. The results are exhibited in the form of streamlines, isotherms, and local and average Nusselt numbers for two cases, namely, the constant and the sinusoidal heated lower wall of the conduit. In both cases, the side walls of the cavity are cold and the upper side is insulated. The main difference between the two cases is observed from temperature contours. For constant heated bottom wall a finite discontinuity appears in the temperature distribution at the corners of the bottom wall. In contrast, no such discontinuity appears in the temperature distribution for non-uniform heated bottom wall. The quantitative changes in temperature contours in different portions of the cavity are identified by comparing the results for both cases. The code is also validated and benchmarked with the previous numerical data available in the literature. It is found that the magnetic field inclined at a certain angle either suppresses or enhances the intensity of primary circulations depending on the inclination of the cavity. Further, the average Nusselt number at the bottom wall is higher when magnetic field is applied vertically irrespective of the inclination of cavity. The analysis presented here has potential application in solar collectors and porous heat exchangers.