Use the console
As with previous Bethesday games, the markfordelete or disable console commands can be used to force an entity to despawn.
Using markfordelete may be safer as there are some indications that using disable will not remove the object from the world state in your savegame.
The former is also less likely to bug out as it should follow the default cleanup behaviour.
Via
the Wiki : markfordelete - Similar to disable, will delete any item from the game, removing it permanently.
It may disappear immediately, or it may require you to exit and re-enter the area.
While I haven't confirmed this myself, using the console apparently does not disable achievements.
gaming.stackexchange.com/users/106152/Lilienthal
if you have running water nearby you can drag the corpse there and watch it float away
gaming.stackexchange.com/users/129950/anon
Build a small shack and drag all bodies there? =Build a graveyard.
gaming.stackexchange.com/users/64396/SkyHiRider
Chances are it is not despawning because you are visiting the "cell" or loaded area, frequently.
Travel far away from the settlement in question, and do not go back for about 10-15 in-game days
(you can sleep/wait it off if you wish) that will "reset" the cell which will remove any temporary mobs.
That should fix your problem.
If you go back to the settlement too early, this 10-15 day timer will reset. if you do not wish to do that then use Disable in-console.
Do NOT use markfordelete.
Most of the creatures that spawn are Randomly generated.
If you use markfordelete, it will delete that creature and any spawns like it afterwards.
EX.5 Raiders attack a settlement.
I kill them.
I use markfordelete on one of them.
there is a good chance that if raiders attack again, there will only be 4 raiders.
This is what happened with skyrim so I cannot imagine it being any different.
On top of that markfordelete is permanent, so you can't fix mistakes.
Yes, disable doesnt "remove" the mob from the game, but it unloads it from memory, and prevents FO4 from loading it again, so while it may slow down load times, it will not affect fps or anything else in-game.
It is just a much more safer option to choose.
gaming.stackexchange.com/users/129842/ThreeTen
It's not ideal but it saves using console commands but you could "bin" all the corpses.
I have erected 4 walls and a staircase leading up.
you can dump them inside.
It gets them out of the way
gaming.stackexchange.com/users/129618/jollins
I have a batch file which I run every start.
One of the lines is: setgs iHoursToClearCorpses 2 As ThreeTen suggested, go away from the cell for a while.
If you use MarkForDelete , try using Disable first, in case you've selected the wrong item (like Dogmeat!).
You can then MarkForDelete once you're sure you have the intended target.
gaming.stackexchange.com/users/133795/mykl_c
There is a mod that can help you get rid of corpses in your settlements.
(and it gives you materials for the bodies!)
Scrap dead things I do not personally use this mod, so I can not account for how well it works.
gaming.stackexchange.com/users/80960/Caleb
I was having this same trouble until i noticed that only corpses with items in them were lingering around my settlements.
Try looting all the items inside the corpses.
It should allow them to dissapear.
gaming.stackexchange.com/users/136384/Vaultboy95
So I killed a bunch of raiders from a settlement, now their rotting fly infested corpses are lying around clogging up the joint.  How do I dispose of their corpses?
How do I dispose of a corpse?
gaming.stackexchange.com
<fallout-4>
gaming.stackexchange.com/questions/242857
gaming.stackexchange.com/users/3917/l I
If you have running water nearby you can drag the corpse there and watch it float away. There is also a mod that can help you get rid of corpses in your settlements.   While there isn't any specific way to make corpses dissapear, without using mods, most users are suggesting to move the bodies.
The community lists few ways to deal with corpses.