Relative permeability is a critical parameter characterizing multiphase flow in porous media and it is strongly dependent on the wettability. In many situations, the porous media are nonuniformly wet. To investigate the effect of wettability heterogeneity on relative permeability of two‐phase flow in porous media, a multi‐relaxation‐time color‐gradient lattice Boltzmann model is adopted to simulate oil/water two‐phase flow in porous media with different oil‐wet solid fractions. For the water phase, when the water saturation is high, the relative permeability of water increases with the increase of oil‐wet solid fraction under a constant water saturation. However, as the water saturation decreases to an intermediate value (about 0.4–0.7), the relative permeability of water in fractionally wet porous media could be lower than that in purely water‐wet porous media, meaning additional flow resistance exists in the fractionally wet porous media. For the oil phase, similar phenomenon is observed. This phenomenon is mainly caused by the wettability‐related microscale fluid distribution. According to both our simulation results and theoretical analysis, it is found that the relative permeability of two‐phase flow in porous media is strongly related to three parameters: the fluid saturation, the specific interfacial length of fluid, and the fluid tortuosity in the flow direction. The relationship between the relative permeability and these parameters under different capillary numbers is explored in this paper.