Interleukin (IL)-23 is a validated therapeutic target in inflammatory bowel disease. While antibodies targeting IL23 demonstrate clinical efficacy, they face challenges such as high costs, safety risks, and the necessity of parenteral administration. Here, we present a workflow to simultaneously enhance the affinity and protease stability of an inhibitory anti-IL23R VHH for oral use. Cocrystal structure analysis reveals that the anti-IL23R VHH employs both CDR and framework residues to achieve picomolar affinity for IL23R. The engineered VHH remains stable for over 8 h in intestinal fluid and 24 h in fecal samples. Oral administration of this VHH achieves deep pathway inhibition in a murine colitis model. Furthermore, a single pill provides sustained IL23R inhibition in nonhuman primate blood for over 24 h. With high potency, gut stability, high production yield, and favorable drug-like properties, oral VHHs offer a promising approach for inflammatory bowel diseases.