This paper investigates natural convection heat transfer of generalized Oldroyd-B fluid in a porous medium with modified fractional Darcy's law. Nonlinear coupled boundary layer governing equations are formulated with time–space fractional derivatives in the momentum equation. Numerical solutions are obtained by the newly developed finite difference method combined with L1-algorithm. The effects of involved parameters on velocity and temperature fields are presented graphically and analyzed in detail. Results indicate that, different from the classical result that Prandtl number only affects the heat transfer, it has remarkable influence on both the velocity and temperature boundary layers, the average Nusselt number rises dramatically in low Prandtl number, but increases slowly with the augment of Prandtl number. The maximum value of velocity profile and the thickness of momentum boundary layer increases with the augment of porosity and Darcy number. Moreover, the relaxation fractional derivative parameter accelerates the convection flow and weakens the elastic effect significantly, while the retardation fractional derivative parameter slows down the motion and strengthens the elastic effect.