Hyperref and titlesec conflict and warning

Use a \phantomsection before each manual addition of a \subsection* to the ToC (and bookmarks) in order to reestablish the hyper anchors.

\documentclass[11pt,a4paper]{article}

\usepackage{titlesec}
\usepackage{hyperref}

\begin{document}

\section*{This is a section}
\addcontentsline{toc}{section}{This is a section}

\clearpage
\phantomsection
\subsection*{This is subsection 1}
\addcontentsline{toc}{subsection}{This is a subsection 1}

\clearpage
\phantomsection
\subsection*{This is subsection 2}
\addcontentsline{toc}{subsection}{This is a subsection 2}

\end{document}