A frequency selective surface (FSS) based metamaterial structure with holes is proposed for 5G electromagnetic (EM) shielding. The proposed FSS can not only realizes the compact dual band-stop characteristics of close distance successfully, but also improves the ventilation and heat dissipation capacity compared to metallic enclosure. Taking −10 dB as the threshold for bandwidth measurement, the proposed FSS has two stop bands with central operating frequencies of 3.5GHz and 4.86GHz. The first suppressed bandwidth can reach 1.17GHz and the second can reach 0.67GHz. The proposed design shows a stable frequency response for the angles of incidence ranging from 0 to 45° for both TE and TM polarized electromagnetic signals. Through the analysis, an optimized FSS is designed which improves the shielding effect for both bands with bandwidth exceeding 1GHz and attenuation exceeding 30dB. In addition, the optimized metamaterial improves the angular stability to 60°. The proposed design has a great significance for the further development of 5G communication.