Erratic noise often has high amplitudes and a non-Gaussian distribution. Leastsquares-based approaches therefore are not optimal. This can be handled better with non-least-squares approaches, for example based on Huber norm which is computationally expensive. An alternative method has been published which involves transforming the data with erratic noise to pseudodata that have Gaussian distributed noise. It can then be attenuated using traditional least-squares approaches. This alternative method has previously been used in combination with a curvelet transform in an iterative scheme. In this paper, we introduce a median-filtering step in this iterative scheme. The median filter is applied following the slope direction of the seismic data to maximally preserve the energy of useful signals. The new method can suppress stronger erratic noise compared with the previous iterative method, and can better deal with random noise compared with the single-step implementation of the median filter. We apply the proposed robust denoising algorithm to a synthetic dataset and two field data examples and demonstrate its advantages over three different noise attenuation algorithms.