Organization of signaling complexes at excitatory synapses by membrane-associated guanylate kinase (MAGUK) proteins regulates synapse development, plasticity, senescence and disease. Post-translational modification of MAGUK family proteins can drive their membrane localization, yet it is unclear how these intracellular proteins are targeted to sites of synaptic contact. Here we show using super-resolution imaging, biochemical approaches and in vivo models that the trans-synaptic organizing protein ephrin-B3 controls the synaptic localization and stability of PSD-95 and links these events to changes in neuronal activity via negative regulation of a newly identified mitogen-associated protein kinase (MAPK)-dependent phosphorylation site on ephrin-B3, Ser332. Unphosphorylated ephrin-B3 was enriched at synapses, and interacted directly with and stabilized PSD-95 at synapses. Activity-induced phosphorylation of Ser332 dispersed ephrin-B3 from synapses, prevented the interaction with PSD-95 and enhanced the turnover of PSD-95. Thus, ephrin-B3 specifies the synaptic localization of PSD-95 and likely links the synaptic stability of PSD-95 to changes in neuronal activity.