In this work, biomass lignocellulosic materials extracted via chemical and physical treatments from bean and pistachio pod waste were used for the optimized elimination of Indigo Carmine (IC) from aqueous medium, using a design of experiments methodology. The physicochemical properties of the studied materials (raw and treated counterparts) used for the sorption of IC were investigated by Fourier transform infrared spectroscopy (FTIR), X-ray diffraction (XRD), scanning electron microscopy (SEM) coupled with EDX, and thermal analysis. Key variables influencing the adsorption of IC, namely the initial IC concentration, the pH of the solution, the stirring time and the mass of adsorbents, were optimized by the central composite design (CCD) with three center points, the measured response being the amount of IC adsorbed. The optimal conditions obtained from the statistical analysis for the removal of IC were as follows: maximum adsorbed amounts of IC: 1.81 mg/g, 2.05 mg/g, 3.56 mg/g; 7.42 mg/g, 8.95 mg/g, 15.35 mg/g, for raw bean pods (RBS), BST1 and BST2 (bean pods chemically treated), and for raw pistachio pods (RPS), PST1 and PST2 (pistachio pods chemically treated), respectively. The pseudo-second-order nonlinear kinetics model well described the IC adsorption kinetics for RBS, BST1 and BST2, while the Elovich model was properly fitted by RPS, PST1, and PST2 biomaterials data. The Freundlich isotherm best described the shrinkage of IC on different sorbents. The good correlation of the experimental data of the IC with respect to the Freundlich isotherm indicated a multilayer adsorption with heterogeneous adsorption sites and different energies. The interest of this work consisted in developing analytical methods for the treatment of water polluted by dyes by using biosorbents, local biological materials widely available and inexpensive. The results collected in this work highlighted the interesting structural, morphological, and physico-chemical properties of the agro-waste used in the study, which properties allowed an important fixation of the target dye in solution. The research showed that the agro-waste used in the study are possible precursors to locally manufacture adsorbents at low cost, thus allowing the efficient removal of waste and dyes in liquid effluents.