More specifically, in your refuse pile, disable the acceptance of corpses and remains, but leave body parts. This will let you collect things like bones, shells, hooves, ivory. However, it also collects useless parts like cartilage, hair, nervous tissue (which can rot, seeming to increase the spawn of vermin, although it doesn't produce miasma), or parts subject to decay, like goblin arms or other bits lopped off during combat or from weapon traps. That said, with the list from Body Parts you can tell it to accept only certain creatures (e.g. only mussel, turtle) to help prevent the collection of bits that can rot.
For my self, I have a refuse pile near my craftshops which accepts Corpses - Warthog (because in my biome I frequently get dead warthogs in my traps, or killed by incoming merchant guards), and Body Parts - Warthog, Cow, Donkey, Horse, Dog, Mussel, Turtle. These are the creatures I frequently butcher, so this allows the storage of their bones and other useful parts. Note that you'll very likely have to manually set cartilage/hair for dumping after a string of butchering.
As for goblin parts, I actually do have my stockpile accept goblin corpses and goblin parts, but this requires special consideration. I have an execution shaft with eventually produces "[goblin name's] bone #" stacks from my executions, and these are considered corpses by the game. However, most kills by my military do not produce these kinds of corpses, frequently leaving only partial skeletons that cannot be butchered due to dwarven ethics. Occasionally direct military kills will produce bone, presumably from lopped off parts. Regardless of how they died, I wait until the goblin corpses/body parts have completely decayed before going into the stocks - corpses and stocks - body parts and reclaiming/dumping them according to what they are.