I am making a server, and I want to teleport the closest player to a certain area. But I don't know how to make the command blocks invisible, so the players don't see them. Does anyone know how?
You can have commandblocks somewhere else (however prefered in same chunk to have it loaded), then use alternative command syntax.
/tp @p[x=100,y=64,z=100,r=3] ~0 ~30 ~0
..this commandblock will look at given XYZ coordinates and will search for nearest player in radius of 3 blocks. Then it will teleport him 30 block up (relative to player in case of
/tp - but you can use also hard-coded coordinates)
For activating the commandblock, you can make it always active (via CB settings or redstone clock), thus it will teleport players whenever they enter the scanned area. Or you can make some redstone circiut, or wireless redstone (via mods, plugins, or via another commandblocks - if you need some advanced computing and have only sparse space, you can use only one CB (with button-like activation) to just place redstone block on another place, then activating the circuits)
For more study how this works, you can read the wiki article about command syntax, what other target selectors you can use etc, here.
You can use the Barrier block to cover the command block.
Barriers are not listed in the creative inventory (similarly to command blocks and structure blocks) and can only be obtained using commands, such as /give minecraft:barrier.From: http://minecraft.gamepedia.com/Barrier.
After obtaining the barrier block, simply select the Barrier block and place it around the command block. How the Barrier block looks like and the properties of it can be found here: Barrier Block