  How many cliques can a graph on $n$ vertices have with a forbidden
substructure? Extremal problems of this sort have been studied for a long time.
This paper studies the maximum possible number of cliques in a graph on $n$
vertices with a forbidden clique subdivision or immersion. We prove for $t$
sufficiently large that every graph on $n \geq t$ vertices with no
$K_t$-immersion has at most $2^{t+\log^2 t}n$ cliques, which is sharp apart
from the $2^{O(\log^2 t)}$ factor. We also prove that the maximum number of
cliques in an $n$-vertex graph with no $K_t$-subdivision is at most
$2^{1.817t}n$. This improves on the best known exponential constant by Lee and
Oum. We conjecture that the optimal bound is $3^{2t/3 +o(t)}n$, as we proved
for minors in place of subdivision in earlier work.
