Amphibian populations have been declining worldwide, with multiple potential causes. At La Selva field station in north-eastern Costa Rica, previous work has shown that populations of many amphibians have decreased significantly since the 1970s, especially in primary forest. Starting in 1998, we investigated one of the most common frog species at La Selva, the poison-dart frog Oophaga pumilio (= Dendrobates pumilio). In a survey of 50 plots of 100 m2 in 1998, adult frogs were 4.6 times more abundant in secondary forest than in primary forest. Tadpoles were found only in secondary-forest plots. Almost all (89%) of the tadpoles were found in leaf axils of Dieffenbachia spp., which were much more abundant in secondary-forest than in primary-forest plots. The greater abundance of Dieffenbachia spp. in secondary forest was confirmed in a broad survey of ~11 km of trails within La Selva in 2002. When the same trails were resampled in 2012, Dieffenbachia spp. had been extirpated from 72% of the 50-m segments where plants were present in 2002; abundance was greatly reduced in the few trail segments where any Dieffenbachia spp. remained in 2012. The loss of Dieffenbachia spp., especially in secondary forest, removed the species most often used by O. pumilio for tadpole rearing. Based on counts of calling frogs in 2010, there was no difference in O. pumilio abundance in primary versus secondary forest, in striking contrast to multiple earlier surveys that found much greater frog abundance in secondary forest. We propose that the reason for the rapid decline in Dieffenbachia spp. is herbivory by the collared peccary (Pecari tajacu), which has increased in abundance at La Selva in recent years. A likely consequence is continued reduction in O. pumilio populations.