Plain TeX, 87 bytes
\def\p#1{\phantom{#1}\egroup}{\obeylines\gdef~{\bgroup\obeylines\obeyspaces\def { }\p}}
(including the carriage return).
Explanations
The typesetting program TeX has a command \phantom to generate invisible contents. We can then simply define a command with
\def~#1{\phantom{#1}}
which corresponds to 21 bytes.
The problem is that TeX aggregate successive spaces (SPC) and ignore carriage return (CR) in command arguments. To change that, we can add
\obeylines \obeyspaces \def^^M{ }
where ^^M gives the ASCII code of the carriage return (CR).
This works, but alters the meaning of SPC and CR in all the rest of the document. Avoiding that is a bit more tricky and needs and auxiliary macro
{% open a group \obeylines% make carriage return char an 'active' character \gdef~{% define ~ globally \bgroup% open a group \obeylines% in this group, make SPC \obeyspaces% and CR be active and act normally \def { }% define the CR to be a space (no % at end of the previous line) \p% call \p }% end of ~ definition }% close the current group: SPC and CR retrieve their standard definitions \def\p#1{% \phantom{#1}% generate invisible content \egroup% close the current group }
Test code
\def\p#1{\phantom{#1}\egroup}{\obeylines\gdef~{\bgroup\obeylines\obeyspaces\def { }\p}} \tt \frenchspacing >1234567890123< 13 spaces\par >~{Hello, World!}< \vskip 1em >12< 2 spaces\par >~{Hi}< \vskip 1em >123456789012345678901234567890123456789012345< 45 spaces\par >~{ Don't Forget about Existing Whitespace! }< \vskip 1em >< 0 space\par >~{}< \vskip 1em >1234567890123< 13 spaces\par >~{ }< \vskip 1em >1< 1 space\par >~{ }< \bye

Note we need \tt to get a monospaced font (typewriter for TeX) and \frenchspacing to get spaces after punctuation marks (such as the !) have the same width (TeX is designed to typeset documents, not for code golfing).
0x0Aand0x20are the hexadecimal values for the Newline and Space characters respectively \$\endgroup\$These can be any mix of spaces and newlinesYour output can be any mix of spaces and newlines, you can just output spaces if you want, like everyone else, or you can just output newlines. It's up to you \$\endgroup\$