Context. Demographic surveys of protoplanetary disks, carried out mainly with the Atacama Large Millimeter/submillimete Array, have provided access to a large range of disk dust masses (M dust ) around stars with different stellar types and in different star-forming regions. These surveys found a power-law relation between M dust and M that steepens in time, but which is also flatter for transition disks (TDs). Aims. We aim to study the effect of dust evolution in the M dust − M relation. In particular, we are interested in investigating the effect of particle traps on this relation. Methods. We performed dust evolution models, which included perturbations to the gas surface density with different amplitudes to investigate the effect of particle trapping on the M dust − M relation. These perturbations were aimed at mimicking pressure bumps that originated from planets. We focused on the effect caused by different stellar and disk masses based on exoplanet statistics that demonstrate a dependence of planet mass on stellar mass and metallicity. Results. Models of dust evolution can reproduce the observed M dust − M relation in different star-forming regions when strong pressure bumps are included and when the disk mass scales with stellar mass (case of M disk = 0.05 M in our models). This result arises from dust trapping and dust growth beyond centimeter-sized grains inside pressure bumps. However, the flatter relation of M dust − M for TDs and disks with substructures cannot be reproduced by the models unless the formation of boulders is inhibited inside pressure bumps. Conclusions. In the context of pressure bumps originating from planets, our results agree with current exoplanet statistics on giant planet occurrence increasing with stellar mass, but we cannot draw a conclusion about the type of planets needed in the case of low-mass stars. This is attributed to the fact that for M < 1 M , the observed M dust obtained from models is very low due to the efficient growth of dust particles beyond centimeter-sizes inside pressure bumps.