Remove colon in the caption of a figure if the caption is empty

Just loading the caption package should solve this. It makes the colon a proper "separator", i.e. it only appears when there is something to separate.

\documentclass{article}
\usepackage{wrapfig}
\usepackage[demo]{graphicx}
\usepackage{caption}

\begin{document}
\begin{wrapfigure}{l}{4cm}
  \begin{center}
    \includegraphics[width=3cm]{graphic.pdf}
    \caption[Caption for the list of figures]{}
    \label{fig:figureX}
  \end{center}
\end{wrapfigure}
\begin{wrapfigure}{l}{4cm}
  \begin{center}
    \includegraphics[width=3cm]{graphic.pdf}
    \caption[Caption for the list of figures]{With caption}
    \label{fig:figureX}
  \end{center}
\end{wrapfigure}
\end{document}

figures


found some solutions with renewcommand, but this changes the caption style in the whole document.

you can use the solution local (inside the wrapfigure environment)

You don't present a working minimal example. So we don't know any packages or the class in your document.