Application of diversion agents in temporarily plugging fracturing of horizontal wells of shale has becoming more and more popular. Nevertheless, the studies on determining the diverter dosage are below adequacy. A novel approach based on laboratory experiments, logging data, rock mechanics tests and fracture simulation was proposed to optimizing the dosage of diversion agents. The optimization model is based on the classic Darcy Law. A pair of 3D-printed rock plates with rugged faces was combined to simulate the coarse hydraulic fractures with the width of 2.0 ~ 7.0 mm. The mixture of the diversion agents and slickwater was dynamically injected to simulate the fracture in Temco fracture conductivity system to mimic the practical treatment to temporarily plugging the fracture. The permeability of the temporary plugging zone in the 3D-printed fractures was measured in order to optimize the dosage of the selected diversion agents. The value of Pnet (also the value of ΔP in Darcy Formula) required for creation of new branched fractures was determined using the Warpinski-Teufel Failure Rules. The hydraulic fractures of target stages were simulated to obtain the widths and heights. The experimental results proved that the selected suite of the diversion agents can temporarily plug the 3D-printed fractures of 2.0 ~ 7.0 mm with blocking pressure up to 15 MPa. The measured permeability of the resulting plugging zones was 0.724 ~ 0.933 D (averaging 0.837 D). The value of Pnet required for creation of branched fractures in shale of WY area (main shale gas payzone of China) was determined as 0.4 ~ 15.6 MPa (averaging 7.9 MPa) which means the natural fractures and/or weak planes with approaching angle less than 70° could be opened to increase the SRV. The typical dosage of the diversion agents used for one stage of the horizontal wells (averaging TVD 3600 m) was calculated as 232 ~ 310 kg. The optimization method was applied to the design job of temporarily plugging fracturing of two shale gas wells. The observed surface pressure rise after injection of diversion agents was 0.6 ~ 11.7 MPa (averaging 4.7 MPa) and the monitored microseismic events of the test stages were 37% more than those of the offset stages.