So far the measures to mitigate nitrous oxide emissions (N2O) were focused on crop management. However, researchers from Universidad Politécnica de Madrid y Universidad Politécnica de Valencia have focused on the beginning of the chain, where the animal by-products are produced and then are revalued as fertilizers. Two by-products typical from the Mediterranean region were selected to carry out this study, orange pulp and carob. These by-products were added into commercial diets of pigs in substitution of cereals, being respectful with the balance that these diets require to satisfy the animal needs. It was proved that, without a doubt, the excreted components through feces and urine (slurry), for example nitrogenous fractions, lignin, phenolic compounds, etc., varied according to diet. Slurries were used as fertilizers on agricultural soils cultivated with ryegrass, a forage plant used as food for livestock. The N2O emissions were compared to the emissions generated in soils with slurry obtained from pigs fed with a traditional diet.The slurry analysis revealed that the amount of benzoic acid and hippuric acid varied according to the type of diet. It turned out that emissions decreased in soils with higher amount of benzoic acid provided by slurries. This is because such acid reduced the denitrifying microbial capacity of soils which is responsible for most of the N2O emissions to the atmosphere. Taking into account that the hippuric acid degrade into the soil to benzoic acid, slurries with higher amount of these acids released less N2O emissions than the rest of slurries.