Trenches are a depression in the ground traditionally used for soldiers to take cover from incoming fire (in the form of arrows, bullets, and artillery). Trench systems would frequently evolve into tunneling systems to get from one bunker to another. This was very common in World War I especially.
As zombies do not use firearms, incoming fire is not a concern. However, trenches can be used as fortification for a buildings acting a sort of dry moat, trapping large numbers of zombies for easy disposal. Well built and well designed trenches will buy some time, which could be a factor in defending your base from a horde. A visual example can be found in the mansion defenses in the film 28 Days Later.
Trenches can be used for their original purpose against humans wielding firearms. Trenches are known to have a psychological effect on humans, as charging a trench ensures casualties.
Personnel using shovels or entrenching tool would take a long time to dig a trench and use up their energy, which could be fatal once zombies are upon them. The most practical way of digging would be to use construction vehicles like a backhoe or bulldozer. If vehicles not available, opting to build trenches may not be the most effective use of time and energy to combat the undead.
Army Order 38Edit
The Romans dug trenches during the zombie outbreak at Fanum Cocidi in a battleplan that subsequently became known as Army Order 38. Two were dug deeper than an average man (or zombie) is tall and angled inward; they would either fall into a trench or be directed to a narrow point where few zombies could fit at one time and thus be dispatched without fear of being overwhelmed. The trenches were lined with stakes and filled with oil which was set on fire, so zombies that fell in would get trapped and burned to death. This trench strategy allowed the Roman force using only swords to defeat a horde almost 19 times numerically superior while losing only some 30% of their men.
Battle of YonkersEdit
During World War Z trenches were dug out at the Battle of Yonkers for soldiers to take the low ground. Unfortunately the soldiers were not properly trained and would shoot at a zombie's chest instead of the head. This lead to US troops becoming cornered inside of the trenches.