Copper pipework does not corrode at random. When it fails from the inside, the water passing through it is usually aggressive in a specific way, and replacing the affected section without changing the water simply resets the clock. The staining that appears in sinks and baths is the early warning, and it arrives years before the leaks do.
Reading the signs in order
Blue green staining in sinks, baths and cistern overflows is dissolved copper coming out of your own pipes, and it is the first stage. A metallic or bitter taste, worst on the first draw of the morning when water has stood, is the same thing. Green deposits at fittings and a slow weep at a joint follow. Then pinhole leaks, and characteristically several within a short period rather than one, because the whole system has been exposed to the same water for the same length of time.
Acidic water, the usual cause
Low pH water dissolves copper steadily, and it is common on private wells in granite and sandstone regions where the groundwater picked up little buffering on its way through. The EPA notes private wells are not federally regulated under the Safe Drinking Water Act, so pH is not monitored on anyone's behalf and the staining is often the first notice an owner gets. Correcting it means a calcite neutralizing tank or a soda ash injection system, chosen according to how low the pH is and how hard the water already is.
The other causes worth ruling out
High velocity erosion corrosion, where water moves fast enough through undersized pipe or tight bends to wear the protective oxide layer away, which shows as failures concentrated at elbows and downstream of restrictions. Aggressive soft water with very low mineral content, including some rainwater and reverse osmosis systems plumbed in copper. Stray electrical current finding a path through the plumbing. And poor workmanship, where aggressive flux left inside a joint attacks it from within.
What to do in what order
Test the water for pH first, since that answers the most likely cause for a few dollars. Correct the chemistry before replacing pipework, or the replacement corrodes on the same schedule. Where pipework is being renewed anyway, consider a material that tolerates the water rather than repeating the installation. And bear in mind that treatment which raises pH by dissolving calcium carbonate makes the water harder, so a softener sized for the new figure often follows. Our water treatment guide covers the sequence.
Questions people ask about corroded copper pipes
What do blue green stains in a sink mean?
Dissolved copper from your own pipework, which means the water is acidic and is corroding the plumbing from the inside.
Why have several pinhole leaks appeared at once?
The whole system has been exposed to the same aggressive water for the same time, so failures cluster rather than occurring singly.
Should I replace the pipe or treat the water?
Treat the water first. Replacing pipework without correcting the chemistry means the new pipe corrodes on the same schedule.
What if the pH is fine?
Look at erosion corrosion from high velocity in undersized pipe, very soft aggressive water, stray current, or flux left in joints.