We present a model for the filtration of dislocations inside the seed window in epitaxial lateral overgrowth (ELO). We found that, when the additive effects of image and gliding forces exceed the defect line tension force, filtering can occur even in the openings. The model is applied to ELO of InP on Si where the opening size and the thermal stress arising due to the mask and the grown material are taken into account and analyzed. Further, we have also designed the mask patterns in net structures, where the tilting angles of the openings in the nets are chosen in order to take advantage of the filtering in the openings more effectively, and to minimize new defects due to coalescence in the ELO. Photoluminescence intensities of ELO InP on Si and on InP are compared and found to be in qualitative agreement with the model.