Glutamate ionotropic receptors mediate fast excitation processes in the central nervous system of vertebrates and play an important role in synaptic plasticity, learning, and memory. Here, we describe the action of two azobenene-containing compounds, AAQ (acrylamide-azobenzene-quaternary ammonium) and QAQ (quaternary ammonium-azobenzene-quaternary ammonium), which produced rapid and fully reversible light-dependent inhibition of glutamate ionotropic receptors. The compounds demonstrated voltage-dependent inhibition with only minor voltage-independent allosteric action. Calcium-impermeable AMPA receptors had weaker sensitivity compared to NMDA and calcium-permeable AMPA receptors. We further revealed that the compounds bound to NMDA and calcium-permeable AMPA receptors in different modes. They were able to enter the wide selectivity filter of AMPA receptors, and strong negative voltages caused permeation into the cytoplasm. The narrow selectivity filter of the NMDA receptors did not allow the molecules to bypass them; therefore, QAQ and AAQ bound to the shallow channel site and prevented channel closure by a foot-in-the-door mechanism. Computer simulations employing available AMPA and NMDA receptor structures readily reproduced the experimental findings, allowing for the structure-based design of more potent and selective drugs in the future. Thus, our work creates a framework for the development of light-sensitive blockers of calcium-permeable AMPA receptors, which are desirable tools for neuroscience.