Although metacommunity models generally formulate dispersal as a random, passive process, mounting evidence suggests that dispersal can be an active process depending on species fitness over the landscape, particularly in multitrophic communities. How different dispersal modes (i.e. from random to increasingly fitness-dependent dispersal) modulate the effect of dispersal on biodiversity remains unclear. Here, we used a metacommunity model of food webs to investigate the effects of dispersal and habitat heterogeneity on biodiversity and how these effects may be dependent on dispersal mode. Our results showed that compared to isolated systems, random dispersal increased local food web diversity ( diversity) but decreased across-community dissimilarity ( diversity) and regional food web diversity ( diversity), consistent with findings from competitive metacommunity models. However, fitness-dependency could alter the effects of dispersal on biodiversity. Both and diversity increased with the strength of fitness-dependency of dispersal, while diversity peaked at intermediate fitness-dependency. Notably, strong fitness-dependent dispersal maintained levels of and diversity similar to those observed in isolated systems. Thus, random dispersal and isolation (i.e. no dispersal) can be considered as two extremes along the continuum of fitness-dependent dispersal, in terms of their effects on biodiversity. Moreover, both biodiversity-habitat heterogeneity and biodiversity-habitat connectivity relationships depended on the dispersal mode. Strikingly, under random dispersal, diversity decreased with habitat heterogeneity and connectivity, but under strong fitness-dependent dispersal, it increased with habitat heterogeneity and remained unchanged as habitat connectivity increased. Our study highlights the context dependence of dispersal effects on biodiversity in heterogeneous landscapes. Our findings have useful implications for biodiversity conservation and landscape management, where management strategies should account for different modes of dispersal across taxa, thus different responses of biodiversity to habitat heterogeneity and connectivity.