Remove unused db fields and save 'wpVersion' when needed

Fix #1133