You create a ward against magical travel that protects up to 40,000 square feet of floor space to a height of 30 feet above the floor. For the duration, creatures can't teleport into the area or use portals, such as those created by the gate spell, to enter the area. The spell proofs the area against planar travel, and therefore prevents creatures from accessing the area by way of the Astral Plane, Ethereal Plane, Feywild, Shadowfell, or the plane shift spell.
In addition, the spell damages types of creatures that you choose when you cast it. Choose one or more of the following: celestials, elementals, fey, fiends, and undead. When a chosen creature enters the spell's area for the first time on a turn or starts its turn there, the creature takes 5d10 radiant or necrotic damage (your choice when you cast this spell).
When you cast this spell, you can designate a password. A creature that speaks the password as it enters the area takes no damage from the spell.
The spell's area can't overlap with the area of another forbiddance spell. If you cast forbiddance every day for 30 days in the same location, the spell lasts until it is dispelled, and the material components are consumed on the last casting.
* - (a sprinkling of holy water, rare incense, and powdered ruby worth at least 1,000 gp)
I feel like InsaneFlame2's answer was nearly touching on something about this spell that I noticed, but got a bit complicated...
Basically, if you want your goblins/orcs/BBEG to be protected from this spell... Put them downstairs, on the 2nd, 3rd etc. level of the dungeon. The spell specifies that it affects space up to 30ft above the spell's effect, but not below it, and I think a DM would be well within their right to rule that stairs/ladders/holes in the floor break up the "floor space" mentioned in the spell.
You're the DM. Ban whatever you like.
It's usually better to find a way around it, though, and forbiddance is far from impenetrable. Arcanist's Magic Aura is a brutally simple way to get around the damage by disguising a creature's type. As for the teleportation, maybe something like wind walk achieves the same effect, with a little cunning to get around the 1 minute transformation time.
Yeah, I think that's perfectly correct. If the spell effect emanates from the floor, a ceiling/floor would create total cover from the effect. The caster would need to walk through floors above and below when casting the spell to include them.
so regarding the whole needing to walk through and see the area you want to affect, couldn't you just have an invisible familiar go through while you stay safe? this isn't a concentration spell so if you could get a familiar for the cleric I don't see whats stopping them besides a dungeon already being under the effect of an enemy's forbiddance.
Cool, now the DM can reveal all those 'undead' were actually an army of Rakshasa, and are immune to all spells of 6th level.