Player heads keep their display names and lore tags after being placed down and picked up again.
This is an unofficial fix for MC-174496, which was finally fixed in 1.20.5!
- mod for Minecraft 1.16 - 1.20.4 (and 1.20.5 to upgrade your world one last time, see the changelog)
- works server-only
If you still want lore and other custom data to be kept in 1.21+, you can use the datapack continuation of this mod, "Keep Head Data".