How do I hide all the sections and subsections of one chapter from the contents page?

What I want is if I have this:

\documentclass[12pt, a4paper, draft, titlepage]{report}

\begin{document}

\tableofcontents
\chapter{This chapter is listed in the contents page}
\section{So are all its sections}
\subsection{--- and subsections!}

\chapter{This chapter name is listed in the contents page}
\section{But this section doesn't appear on the contents page.}
\subsection{This section doesn't appear on the contents page either.}
\end{document}


I want it to appear like this:

But of course, it appears like this:

Is there any way I can hide all the sections and subsections of that specific chapter?

You can change the value of the counter tocdepth mid-document, writing it to the ToC at the appropriate spot. This allows you to vary what shows and what doesn't show.

\documentclass{report}

\begin{document}

\tableofcontents

\chapter{This chapter is listed in the contents page}
\section{So are all its sections}
\subsection{--- and subsections!}

% From this point on, only show up to \chapters in the ToC

\chapter{This chapter name is listed in the contents page}
\section{But this section doesn't appear on the contents page.}
\subsection{This section doesn't appear on the contents page either.}

% From this point on, only show up to \subsection in the ToC
\chapter{This chapter is listed in the contents page}
\section{So are all its sections}
\subsection{--- and subsections!}

\end{document}


Sectional units have the following "level":

• -1 = \part
• 0 = \chapter
• 1 = \section
• 2 = \subsection
• 3 = \subsubsection
• 4 = \paragraph
• 5 = \subparagraph

Other document classes may offer different levels.