Performing visual search tasks requires optimal attention deployment to promote targets and inhibit distractors. Rejection templates based on the feature of the distractor can be built to constrain the search process. We measured electroencephalography (EEG) of human participants of both sexes when they performed a visual search task in conditions where the distractor cues were constant within a block (fixed cueing) or changed on a trial-by-trial basis (varied cueing). In the fixed-cueing condition, sustained decoding of the cued colors could be achieved during the retention interval, and participants with higher decoding accuracy showed larger suppression benefits of the distractor cueing in the search period. In the varied-cueing condition, the cued color could only be transiently decoded after its onset, and higher decoding accuracy was observed from the participants who demonstrated lower suppression benefit. The differential neural representations of the to-be-ignored color in the two cueing conditions as well as their reverse associations with behavioral performance implied that rejection templates were formed in the fixed-cueing condition but not in the varied-cueing condition. Additionally, we observed stronger posterior alpha lateralization and midfrontal theta/beta power during the retention interval of the varied-cueing condition, indicating the cognitive costs in template formation caused by the trialwise change of distractor colors. Together, our findings revealed the neural markers associated with the critical roles of distractor consistency in linking template formation to successful inhibition.