Functional dyspepsia (FD) is a common functional gastrointestinal disorder with high morbidity. Electroacupuncture (EA) has been applied to treat FD for a long time. The aim of this study was to investigate the effects of EA and its mechanism about intestinal mucosal barrier in rodent model of FD. Male Sprague–Dawley rats were randomly divided into the control group and the model group. Then, the rats in model group were established to the FD model by multifactor interventions. In Experiment 1, qualified FD‐like rats were randomly divided into three groups: FD, EA, and acupuncture (AP) groups. The interventions of EA and AP lasted 14 days, food intake, and body weight were recorded every 5 days. In Experiment 2, qualified FD‐like rats were randomly divided into five groups: FD, EA, AP, EA + TAK242, and TAK242 groups. The interventions of EA and AP lasted 14 days, while TAK242 injection continued for 6 days. The rats were sacrificed for the measurement of serum Interleukin‐ 6 (IL‐6) and Tumor necrosis factor‐α (TNF‐α) assayed by ELISA. Western blotting was used to assess the expression of TLR4, Myd88, NF‐κB p65, p‐NF‐κB p65, TRAF6, ZO‐1, and occludin in the duodenum. The transmission electron microscope was used to observe the ultrastructure of intestinal epithelial cells. Compared with the rats in the group FD, the rats in EA group had significantly increase of body weight, food intake, and protein expressions of ZO‐1 and occludin, while expressions of TLR4, Myd88, NF‐κB p65, p‐NF‐κB p65, TRAF6 in the duodenum and IL‐6, and TNF‐α in serum were decreased. The EA + TAK242 treatment had similar effects to the EA treatment but with increased potency; compared with EA, AP showed similar but reduced effects. Our data demonstrated that EA is more effective than AP in improving intestine mucosal barrier. The possible mechanisms of EA may involve the TLR4/NF‐κB p65 pathway.