The paper discusses a numerical approach to solving complicated partial differential equations, with a particular emphasis on fractional advection-dispersion equations of space-time variable order. With the use of fractional derivative matrices, Legendre polynomials, and numerical examples and comparisons, it surpasses current methods by utilizing spectral collocation techniques. It resolves equations involving spatial and time variables that are variable-order fractional advection–dispersion (VOFADE). Legendre polynomials serve as basis functions in this method, whereas Legendre operational matrices are employed for fractional derivatives. The technique is more computationally efficient since it reduces fractional advection–dispersion equations to systems of algebraic equations. Numerical examples and a comparison with current approaches illustrate the method’s superior performance in solving complicated partial differential equations, especially in the context of transport processes.