We show scalable and complete suppression of the recently reported terahertz-pulse-induced switching between different resistance states of antiferromagnetic CuMnAs thin films by ultrafast gating. The gating functionality is achieved by an optically generated transiently conductive parallel channel in the semiconducting substrate underneath the metallic layer. The photocarrier lifetime determines the time scale of the suppression. As we do not observe a direct impact of the optical pulse on the state of CuMnAs, all observed effects are primarily mediated by the substrate. The sample region of suppressed resistance switching is given by the optical spot size, thereby making our scheme potentially applicable for transient low-power masking of structured areas with feature sizes of ~100 nm and even smaller.