I can't find a way to remove only the page index of sections while keeping the page index of the subsections

• Welcome to tex.sx. The setting of section information is defined in the document class, so if anyone is to be able to help you, we need to know that. For best results, please include a complete small example, beginning with \documentclass and ending with \end{document} that demonstrates what you're getting now. Aug 16, 2021 at 15:31

Assuming you're using one of the "standard" LaTeX document classes (or a document class that's based on one of the standard classes), you could employ the machinery of the tocloft package to achieve your formatting objective.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage{setspace}
\setstretch{1.5}  % just for this example

\setcounter{secnumdepth}{0}
\setcounter{tocdepth}{2} % or some higher number

\usepackage{tocloft} % modify appearance of ToC, LoF, and/or LoT
\makeatletter
% Don't show section page numbers in ToC:
\renewcommand{\cftsecpagefont}{\@gobble}
\makeatother

\begin{document}
\tableofcontents

\clearpage
\section{Dati dell'opera}
\subsection{Informazioni generali}
\subsection{Storia dell'opera}
\clearpage
\stepcounter{page}
\subsection{Studi per l'opera}

\clearpage
\section{Leonardo da Vinci}
\subsection{Biografia}
\clearpage
\stepcounter{page}
\subsection{Movimento artistico: Il Rinascimento}
\end{document}

• Thank you, I tried to apply your suggestion but (the numbers disappeared as i wanted) but now the same dots that were to the side of subsections appeared also to the side of sections. Aug 16, 2021 at 16:54
• @MichaelB - Sadly, but probably not surprisingly, my mind-reading and psychic divination skillls are pure rubbish. Please feel free to tell us a lot more about your document setup, including which document class you employ. Without this information, chances that anyone will be able to guess correctly what's going on in your document, let alone come up with a solution, will be slim to nonexistent.
– Mico
Aug 16, 2021 at 18:19