We present an algorithm for the identification of transient noise artifacts (glitches) in cross-correlation searches for long O(10s) gravitational-wave transients. The algorithm utilizes the auto-power in each detector as a discriminator between well-behaved Gaussian noise (possibly including a gravitational-wave signal) and glitches. We test the algorithm with both Monte Carlo noise and time-shifted data from the LIGO S5 science run and find that it is effective at removing a significant fraction of glitches while keeping the vast majority (99.6%) of the data. Using an accretion disk instability signal model, we estimate that the algorithm is accidentally triggered at a rate of less than 10^-5% by realistic signals, and less than 3% even for exceptionally loud signals. We conclude that the algorithm is a safe and effective method for cleaning the cross-correlation data used in searches for long gravitational-wave transients.