Synaptic NMDA receptors (NMDARs) are crucial for neural coding and plasticity. However, little is known about the adaptive function of extrasynaptic NMDARs occurring mainly on dendritic shafts. Here, we find that in CA1 pyramidal neurons, backpropagating action potentials (bAPs) recruit shaft NMDARs exposed to ambient glutamate. In contrast, spine NMDARs are ‘protected’ under baseline conditions, from such glutamate influences by perisynaptic transporters: we detect bAP-evoked Ca2+ entry through these receptors upon local synaptic or photolytic glutamate release. During theta-burst firing, NMDAR-dependent Ca2+ entry either downregulates or upregulates an h-channel conductance (Gh) of the cell depending on whether synaptic glutamate release is intact or blocked. Thus, the balance between activation of synaptic and extrasynaptic NMDARs can determine the sign of Gh plasticity. Gh plasticity in turn regulates dendritic input probed by local glutamate uncaging. These results uncover a metaplasticity mechanism potentially important for neural coding and memory formation.