Despite their extensive use, the therapeutic potential of nonsteroidal anti-inflammatory drugs (NSAIDs) remains significantly constrained by adverse side effects. This limitation primarily arises from insufficient selectivity, as current NSAIDs inhibit not only the inducible cyclooxygenase-2 (COX-2) isoform at sites of inflammation but also constitutive COX-2 in healthy tissues and, frequently, cyclooxygenase-1. To address this challenge, we developed photoswitchable NSAIDs that combine COX-2 selectivity with light-controlled activity to enable spatiotemporal confinement of the therapeutic effect at inflamed tissues. Following computational design and screening of a library of azoaromatic derivatives of celecoxib─the most widely used COX-2 selective NSAID─three photoswitchable analogues were synthesized, which exhibited reversible and efficient trans-cis photoconversion. Light-controlled and selective COX-2 inhibition was demonstrated for these compounds in vitro, reaching up to 5-fold potency enhancement in macrophage assays upon photoisomerization from the initial, dark-adapted trans isomer to the cis state. The best candidate displayed in vivo efficacy in a zebrafish model of acute inflammation, where administration of the photoinduced cis form reduced leukocyte recruitment at the wound site. These findings position photoswitchable NSAIDs as a promising alternative to conventional drugs for treating inflammation and related conditions, including cancer.