Tropical forests are fundamental ecosystems, essential for providing terrestrial primary productivity, global nutrient cycling, and biodiversity. Despite their importance, tropical forests are currently threatened by deforestation and associated activities. Moreover, tropical regions are now mostly represented by secondary forest regrowth, with half of the remaining tropical forests as secondary forest. Soil invertebrates are an important component to the functioning and biodiversity of these soil ecosystems. However, it remains unclear how these past land-use activities and subsequent secondary forest developments have altered the soil invertebrate communities and any potential ecological consequences associated with this. DNA metabarcoding offers an effective approach to rapidly monitor soil invertebrate communities under different land-use practices and within secondary forests. In this study, we used DNA metabarcoding to detect community-based patterns of soil invertebrate composition across a primary forest, a 23-year-old secondary forest, and a 33-year-old secondary forest and the associated soil environmental drivers of the soil invertebrate community structure in the Maquenque National Wildlife Refuge of Costa Rica (MNWR). We also used a species contribution analysis (SIMPER) to determine which soil invertebrate groups may be an indication of these soils reaching a pre-disturbed state such as a primary forest. We found that the soil invertebrate community composition at class, order, family, and ESV level were mostly significantly different across that habitats. We also found that the primary forest had a greater richness of soil invertebrates compared to the 23-year-old and 33-year-old secondary forest. Moreover, a redundancy analysis indicated that soil moisture influenced soil invertebrate community structure and explained up to 22% of the total variation observed in the community composition across the habitats; whereas soil invertebrate richness was structured by soil microbial biomass carbon (C) (Cmic) and explained up to 52% of the invertebrate richness across the primary and secondary forests. Lastly, the SIMPER analysis revealed that Naididae, Entomobryidae, and Elateridae could be important indicators of soil and forest recuperation in the MNWR. This study adds to the increasing evidence that soil invertebrates are intimately linked with the soil microbial biomass carbon (Cmic) and that even after 33 years of natural regrowth of a forest, these land use activities can still have persisting effects on the overall composition and richness of the soil invertebrate communities.