# Center section titles in Beamer metropolis theme

I would like to center only the section titles in the beamer metropolis theme, without changing the other defaults (in particular I would like to keep the progress bar).

I have tried the following, which did not work

\usepackage{sectsty}
\allsectionsfont{\centering}


and the following which worked for the normal titlepage but not for section titles (perhaps I'm using the wrong name?)

\setbeamertemplate{section page}{ % also used section and section title
%  \raggedright%  % <-- Comment here
\inserttitle%
\par%
\vspace*{0.5em}
}


Answer: I was able to do it by removing the \raggedright command from the section page and include \centering instead before the section title

 % Center Section titles
\setbeamertemplate{section page}{
\begin{center} % add center if missing
\begin{minipage}{22em}
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
%\raggedright % comment out raggedright
\centering % add centering here to center title