We propose estimators of the memory parameter of a time series that are robust to a wide variety of random level shift processes, deterministic level shifts, and deterministic time trends. The estimators are simple trimmed versions of the popular log-periodogram regression estimator that employ certain sample-size-dependent and, in some cases, data-dependent trimmings that discard low-frequency components. We also show that a previously developed trimmed local Whittle estimator is robust to the same forms of data contamination. Regardless of whether the underlying long- or short-memory process is contaminated by level shifts or deterministic trends, the estimators are consistent and asymptotically normal with the same limiting variance as their standard untrimmed counterparts. Simulations show that the trimmed estimators perform their intended purpose quite well, substantially decreasing both finite-sample bias and root mean-squared error in the presence of these contaminating components. Furthermore, we assess the trade-offs involved with their use when such components are not present but the underlying process exhibits strong short-memory dynamics or is contaminated by noise. To balance the potential finite-sample biases involved in estimating the memory parameter, we recommend a particular adaptive version of the trimmed log-periodogram estimator that performs well in a wide variety of circumstances. We apply the estimators to stock market volatility data to find that various time series typically thought to be long-memory processes actually appear to be short- or very weak long-memory processes contaminated by level shifts or deterministic trends.