Mucins secreted by goblet cells (GC) are the major components of mucus layer coating and protecting gut epithelium. The study aimed at determining the effect of non‐essential amino acids (NEAA) and threonine (Thr) levels on GC number and mucus layer thickness measured in different parts of the gut. A two‐factorial experiment was conducted on 72 pigs (initial BW 12.5 kg) using as factors: Thr level (5.1, 5.7, 6.3 and 6.9 g standardized ileal digestible [SID] Thr/kg) and wheat gluten (WG) level used as a source of NEAA (20.4, 40.4 and 60.4 g WG protein in WG20, WG40 and WG60 diets respectively). All diets covered the requirement for essential AA, except for Thr, and they were fed to six pigs for 20 days. Thr level affected only the count of GC containing acidic mucins in the proximal colon, which was higher in pigs fed a diet with 5.1 g SID Thr/kg in comparison with diet containing 6.3 g SID Thr/kg. In the villi, WG40 and/or WG60 increased the GC number containing acidic mucins and lowered that with neutral mucins in the middle jejunum. In the crypts, higher WG levels decreased the GC number with acidic mucins in the duodenum, ileum and proximal colon and increased that with neutral and mixed mucins in the duodenum and ileum. The mucus layer was thicker in the proximal and middle jejunum in WG20 pigs, whereas in the proximal colon it was thicker in WG60 pigs. The lowest GC count was found in the middle jejunum and the highest in the duodenum and proximal colon. The mucus layer was the thinnest in the proximal and middle jejunum and the thickest in the ileum. The results did not show the negative effect of a moderate Thr deficiency and the positive effect of non‐essential AA supplementation on GC functions.