In this paper, we have introduced a weighted median method for the estimation of a causal effect using multiple IVs. Unlike other methods commonly used in Mendelian randomization, this method can give consistent estimates when some of the genetic variants in the analysis are not valid IVs. We have shown how the method performs in a simulation study and in an applied example.