In directed C-H activation reactions, any nitrogen or sulphur atoms present in heterocyclic substrates will coordinate strongly with metal catalysts. This coordination, which can lead to catalyst poisoning or C-H functionalization at an undesired position, limits the application of C-H activation reactions in heterocycle-based drug discovery, in which regard they have attracted much interest from pharmaceutical companies. Here we report a robust and synthetically useful method that overcomes the complications associated with performing C-H functionalization reactions on heterocycles. Our approach employs a simple N-methoxy amide group, which serves as both a directing group and an anionic ligand that promotes the in situ generation of the reactive PdX2 (X = ArCONOMe) species from a Pd(0) source using air as the sole oxidant. In this way, the PdX2 species is localized near the target C-H bond, avoiding interference from any nitrogen or sulphur atoms present in the heterocyclic substrates. This reaction overrides the conventional positional selectivity patterns observed with substrates containing strongly coordinating heteroatoms, including nitrogen, sulphur and phosphorus. Thus, this operationally simple aerobic reaction demonstrates that it is possible to bypass a fundamental limitation that has long plagued applications of directed C-H activation in medicinal chemistry.