Automatically remove page number if document has only one page (but not if two)

This doesn't require any extra packages or an extra \label at the end, but it does still write to the aux file.

\documentclass{article}
\usepackage{lipsum}
\title{Test}
\author{Test Testson}

\makeatletter
\AtEndDocument{%
  \ifnum\value{page} > 1%
    \immediate\write\@auxout{\string\xdef\string\@multipage\string{\string}}%
  \fi%
}
\newcommand{\oneormoreside}{\ifdefined\@multipage\else\thispagestyle{empty}\fi}
\makeatother

\begin{document}%
\maketitle
\oneormoreside

%\lipsum[1-60] %More than one page
\lipsum[1]   % One page
\end{document}

Since the information is written to the aux file you need two passes for it to work correctly.


You requested a solution without "extra packages". Here is a solution without zref, but it still needs ifthen:

\documentclass{article}
\usepackage{lipsum,ifthen} 

\begin{document}

\newcommand{\mypagestyle}%
    {\ifthenelse{\pageref{LastPage}>1}%
        {\thispagestyle{plain}}%
        {\thispagestyle{empty}}%
    }
\mypagestyle

\lipsum[2-10] 

\label{LastPage}
\end{document}

P.S. Personally, I would prefer a solution like yours but with lastpage (http://ctan.org/tex-archive/macros/latex/contrib/lastpage) instead of zref.