A baby humpback whale buried near a beach on the NSW North Coast will be exhumed so it doesn't attract sharks to the area.

The dead whale washed up on South Ballina Beach on Sunday and was buried by National Parks and Wildlife behind the sand dunes on Monday.

A baby whale carcass that washed up on South Ballina beach will be buried inland so it doesn't attract sharks. Credit:Office of Environment and Heritage

"This is just a temporary holding point ... our first priority was to get the animal off the beach," Office of Environment and Heritage Richmond River area manager Mark Pirttavino said on Wednesday.

"The most immediate risk was the animal left on the beach."