Around a 20–30% of inflammatory bowel disease (IBD) patients are diagnosed before they are 18 years old. Anti-TNF drugs can induce and maintain remission in IBD, however, up to 30% of patients do not respond. The aim of the work was to identify markers that would predict an early response to anti-TNF drugs in pediatric patients with IBD. The study population included 43 patients aged <18 years with IBD who started treatment with infliximab or adalimumab. Patients were classified into primary responders ( n = 27) and non-responders to anti-TNF therapy ( n = 6). Response to treatment could not be analyzed in 10 patients. Response was defined as a decrease in over 15 points in the disease activity indexes from week 0 to week 10 of infliximab treatment or from week 0 to week 26 of adalimumab treatment. The expression profiles of nine genes in total RNA isolated from the whole-blood of pediatric IBD patients taken before biologic administration and after 2 weeks were analyzed using qPCR and the 2−∆∆Ct method. Before initiation and after 2 weeks of treatment the expression of SMAD7 was decreased in patients who were considered as non-responders ( p value < 0.05). Changes in expression were also observed for TLR2 at T0 and T2, although that did not reach the level of statistical significance. In addition, the expression of DEFA5 decreased 1.75-fold during the first 2 weeks of anti-TNF treatment in responders, whereas no changes were observed in non-responders. Expression of the SMAD7 gene is a pharmacogenomic biomarker of early response to anti-TNF agents in pediatric IBD. TLR2 and DEFA5 need to be validated in larger studies.