You create a ward that protects up to 2,500 square feet of floor space (an area 50 feet square, or one hundred 5-foot squares or twenty-five 10-foot squares). The warded area can be up to 20 feet tall, and shaped as you desire. You can ward several stories of a stronghold by dividing the area among them, as long as you can walk into each contiguous area while you are casting the spell.

When you cast this spell, you can specify individuals that are unaffected by any or all of the effects that you choose. You can also specify a password that, when spoken aloud, makes the speaker immune to these effects.

Guards and Wards creates the following effects within the warded area.

Corridors. Fog fills all the warded corridors, making them heavily obscured. In addition, at each intersection or branching passage offering a choice of direction, there is a 50 percent chance that a creature other than you will believe it is going in the opposite direction from the one it chooses.
Doors. All doors in the warded area are magically locked, as if sealed by an Arcane Lock spell. In addition, you can cover up to ten doors with an illusion (equivalent to the illusory object function of the Minor Illusion spell) to make them appear as plain sections of wall.
Stairs. Webs fill all stairs in the warded area from top to bottom, as the Web spell. These strands regrow in 10 minutes if they are burned or torn away while Guards and Wards lasts.
Other Spell Effect. You can place your choice of one of the following magical effects within the warded area of the stronghold.
Place Dancing Lights in four corridors. You can designate a simple program that the lights repeat as long as Guards and Wards lasts.
Place Magic Mouth in two locations.
Place Stinking Cloud in two locations. The vapors appear in the places you designate; they return within 10 minutes if dispersed by wind while Guards and Wards lasts.
Place a constant Gust of Wind in one corridor or room.
Place a Suggestion in one location. You select an area of up to 5 feet square, and any creature that enters or passes through the area receives the Suggestion mentally.
The whole warded area radiates magic. A Dispel Magic cast on a specific effect, if successful, removes only that effect. You can create a permanently Guarded and Warded structure by casting this spell there every day for one year.