In many visual search tasks, the detection of target objects in visual search requires feature-selective attentional guidance and space-based attentional selection. Feature-based attention is often assumed to operate in a spatially global fashion across the entire visual field, but there is also evidence that it can be restricted to task-relevant locations under some conditions. Here, we investigated whether such spatial filtering processes are already evident when representations of target-defining features (attentional templates) are activated during the preparation for an upcoming search episode. We measured N2pc components (an electrophysiological index of attentional allocation) in response to a rapid series of lateral task-irrelevant but template-matching colour probes that appeared while participants prepared for an upcoming search task with colour-defined targets. Critically, search targets would either always appear in the same lateral regions of visual space as the probes, or at different locations (near fixation or in lateral areas that never contained probes), thus rendering the probed locations either task-relevant or irrelevant. N2pc components triggered by target-colour probes during the preparation period emerged later and were attenuated when probes were presented at irrelevant locations. This demonstrates that the effects of preparatory feature-based attentional templates can be modulated by spatial expectations. However, this type of spatial filtering during search preparation only attenuates but not completely eliminates feature-based attentional modulations.