Inmates can no longer get underwear and socks in the mail as part of an attempt to stop drugs being smuggled into NSW prisons.

Corrective Services NSW will still provide inmates with basic underwear and socks, but if they want brand-name items they will have to buy them off a prison shopping list.

It comes after drugs were found on nine occasions sewn into the lining of socks and undies in the 18 months to February, according to a state government media release.

Corrections Minister David Elliott said the ban complemented other measures including full body scanners, intelligence-based operations and daily searches of staff, inmates and cells.

"Contraband poses a significant threat to the safety and security of correctional centres and it is a constant battle staying one step ahead of inmates gaining access to illegal substances and other contraband," he said.