In longitudinal studies, the inverse probability of treatment weighted (IPTW) method is commonly employed to estimate the effect of time‐dependent treatments on an outcome of interest. However, it has been documented that when the confounders are subject to measurement error, the naive IPTW method which simply ignores measurement error leads to biased treatment effect estimation. In the existing literature, there is a lack of measurement error correction methods that fully remove measurement error effect and produce consistent treatment effect estimation. In this article, we develop a novel consistent IPTW estimation procedure for longitudinal studies. The key step of the proposed method is to use the observed data to construct a corrected function that is unbiased of the unknown IPTW function. Simulation studies reveal that the proposed method outperforms the existing consistent and approximate measurement error correction methods for IPTW estimation of the average treatment effect. Finally, we apply the proposed method to analyze a real dataset.