Riparian vegetation has been compromised worldwide by anthropogenic stressors, including urbanization and livestock grazing. In New Zealand, one consequence has been a reduction in the obligate riparian spawning habitat of Galaxias maculatus. This diadromous species forms the basis of an important fishery where juveniles are caught as they migrate into freshwater. Spawning success of G. maculatus is closely associated with the nature of available riparian habitat. We used a field experiment in a rural stream to test whether livestock grazing limits egg production and whether there is a lag in increased egg production after protection from grazing because of the recovery time of riparian vegetation. In a separate experiment in an urban stream we tested whether improved riparian management can increase egg production. Livestock exclusion produced an immediate and long-lasting increase in the height and density of riparian vegetation with reduced fluctuations in the ground-level physical environment, and positive changes to the density and survival of eggs. After 4 years, egg densities in exclosures were 400 times greater than in grazed controls and egg survival had doubled. Mowing riparian vegetation 2 months prior to spawning reduced egg densities by 75% and survival by 25%. Our experiments showed that altering grazing and mowing in spawning sites produced dense riparian vegetation, that this improved the microsite environment and resulted in greatly increased egg deposition and survival over several years. This clearly indicates that the single most effective step in rehabilitating G. maculatus spawning habitat is a simple reduction in grazing/mowing pressure.