X-ray photoelectron spectra of free-electron metals such as magnesium and aluminium contain pronounced electron energy-loss peaks due to plasmon excitations. Part of the intensity contained in these plasmon peaks is of an intrinsic nature. In this work a procedure is presented that allows the determination of intrinsic and extrinsic contributions to the plasmon loss structure and accounts for possibly different electronic properties at the surface. It is based on the reconstruction of a spectrum by convolution of physically realistic functions for the x-ray energy distribution, the core-level main peak, the crosssections for plasmon excitation and instrumental broadening. The procedure has been applied to an Mg 2p spectrum, giving a total intrinsic plasmon contribution of 46% relative to the main peak intensity.