The title should be self-explanatory but when I refresh a pivot table in Excel 2013 that I have performed a custom sort on, the custom sort is removed and I have to re-apply it again.

Does anyone know why this is or how to prevent it?

It appears to only affect Excel 2013, as I used the same spreadsheet in the past with Excel 2010 and was able to refresh without any issues.