Walling refers to the use of buildings in order to make a choke more narrow (and thus easier to defend) or even completely blocked off in some situations. Applications are usually defensive, but they can also be used offensively to trap players in early on, or in any likely place of battle (usually late game) to give an advantage to your ranged units fight against melee (or lesser ranged) units.
 Competitive Use
For Protoss players walling is most common when playing against Zerg. A Protoss player will usually wall the entrance to his main, leaving a 1x1 gap between buildings, allowing all units to pass through while also allowing the gap to be completely blocked with a Zealot on hold position. This prevents Zerglings from entering the base, while still allowing a Mineral walked probe to leave.
Alternatively, on certain maps, some players tend to build their initial Pylon and later their Gateway(s) at the choke of their natural expansion so that they can wall it off later, making their expansion easier to defend.
Terran players create walls much more frequently than other races do because of the versatility they have from the Supply Depot's ability to lower into the ground as well as the ability of most of their buildings to Lift Off. Most common Terran walls are composed of two Supply Depots and a Barracks or one Barracks, one Factory and one Add on.
Zerg players rarely use buildings to wall off. When in need of a block, Zerg often use units like Queens or Roaches. It is fairly common however to use buildings at the natural expansion versus Terran to create a narrow choke that is easy to block against a Hellion run by.
 with other Buildings
In StarCraft II, any buildings adjacent to each other horizontally or vertically will completely block units from passing between them. If two buildings are placed diagonally so that only their corners meet, only small sized units can pass between them. To see which units can pass between diagonally placed buildings see the #Units that can pass through semi-walls.
- Vespene Geysers act exactly as a normal building would for walling purposes.
|These positions (as well as all positions in between) result in a "tight wall"; no units can pass through. The same applies to similarly placed buildings in horizontal positions.||This placement results in a "semi-wall" through which only small sized units can pass (see list of units below).|
 Exception: 5x5 buildings
The Hatchery/Nexus/CC (5x5 buildings) seem to be exceptions. If a CC is part of a wall-in, it needs to have a common border of length 2 (instead of just 1) with the next building. A common border of length 1 results in a semi-wall, while corner-to-corner placement allows medium size units (e.g. Stalkers, Roaches, but not tanks) through.
 Exception: Crawlers
Spore and Spine Crawlers allow small units (e.g. Zealots, Marauders) to pass through them even when arranged next to each other. They also allow medium size units (e.g. Immortals, but not tanks) to pass if arranged off-by-one.
 with Terrain
Unbuildable Terrain is marked with a yellow hue in the placement grid. Placing any building adjacent to one of these yellow blocks will create a wall just as it would if there was a building there.
- Mineral Fields only create a completely tight wall with buildings even if they are placed diagonally.
 with Unit
If two buildings are placed one space apart from each other, that space can be blocked by any unit, as long as it is placed right between them and ordered to Hold Position. This technique is most commonly used by Protoss players that wall their ramp using two buildings and block the gap with their first Zealot to prevent any Zerglings from running through.
Enemy units that have equal or greater range than your own units can safely attack the wall itself, while your own units cannot attack back from behind the wall. This is a reason why Protoss players do not normally wall against Terrans, who get ranged Marines very early. Similarly, Protoss players can sometimes take advantage of the range of a Void Ray to attack a Terran wall from outside the range of defending Marines.
A wall composed of weaker structures such as Supply Depots or Pylons early on can present a false sense of security, as Zerg players can perform a Baneling Bust to easily break down the wall, leaving the defender with few units to defend against the flood of Zerglings breaching your wall. For this reason, Terran players tend to use Barracks and Factories for their wall as they are much harder to destroy, and can still provide the door function by lifting off. Protoss do not have this advantage and would have to destroy the building (or cancel before it finishes construction) to provide access.
If your wall of Supply Depots or Pylons is breached, you can become supply blocked, rendering you unable to reinforce or produce more units during the attack. Protoss players should also take care not to rely on a single wall Pylon to power important buildings, especially those that would be important in defending against a rush such as Gateways or Photon Cannons.
 Offensive Walling
- 3 Pylons + Cannon early on.
- 2 Bunkers early on
Limits enemy possibilities to worry about. Allows you to safely tech or expand until the eventual breakout and counterattack.
 Walling in Battle Terrain
Engineering Bays (the most HP/cost building) or Bunkers, Turrets, Supply Depots in the entrenched position to give an advantage to ranged units against melee units.
This type of wall is usually only done by Terran.