Newborn pulsars and magnetars turn out to be very promising sources to accelerate cosmic rays up to high and ultrahigh energies, thanks to their rotational and magnetic energy reservoirs. Interestingly, most scenarios that involve hadronic acceleration in these objects should lead to copious amount of neutrino production. Indeed, pulsars and magnetars are not born naked, but surrounded by a dense supernova and a radiative nebula, on which accelerated particles should interact. In this talk, we will review the neutrino fluxes and energies expected for the various types of neutron star populations and for some identified single sources. We will see that the IceCube sensitivities are already placing strong constraints on many of the potential scenarios.