Infant electroencephalography (EEG) presents several challenges compared with adult data. Recordings are typically short. Motion artifacts heavily contaminate the data. The EEG neural signal and the artifacts change throughout development. Traditional data preprocessing pipelines have been developed mainly for event-related potentials analyses, and they required manual steps, or use fixed thresholds for rejecting epochs. However, larger datasets make the use of manual steps infeasible, and new analytical approaches may have different preprocessing requirements. Here we propose an Automated Pipeline for Infants Continuous EEG (APICE). APICE is fully automated, flexible, and modular. Artifacts are detected using multiple algorithms and adaptive thresholds, making it suitable to different age groups and testing procedures without redefining parameters. Artifacts detection and correction of transient artifacts is performed on continuous data, allowing for better data recovery and providing flexibility (i.e., the same preprocessing is usable for different analyses). Here we describe APICE and validate it using two infant datasets of different ages tested in different experimental paradigms. We also tested the combination of APICE with common data cleaning methods such as Independent Component Analysis and Denoising Source Separation. APICE uses EEGLAB and compatible custom functions. It is freely available at https://github.com/neurokidslab/eeg_preprocessing, together with example scripts.