Your phone, the iPad, and your laptop offer a ‘hard reset’ option that resets your device to the default factory settings. Once you perform a factory reset, it erases all the apps, files, and settings and there’s no way to recover the wiped off data.
If you ever need to “factory reset” an old Gmail account that you no longer use, and start afresh with a clean slate, Google Scripts can help. The script will perform a series of tasks to completely reset your Gmail account:
Before you proceed, please understand that hard reset is an irreversible process and you will not be able to recover your Gmail data after the reset is complete.
The Google Script is available on Github or you can click here to make a copy of the script in your Google account. The script uses the official Gmail API to format your Gmail account.
const deleteGmailLabels = () => {
GmailApp.getUserLabels().forEach((label) => {
label.deleteLabel();
});
};
const deleteGmailFilters = () => {
const { filter: gmailFilters } = Gmail.Users.Settings.Filters.list('me');
gmailFilters.forEach(({ id }) => {
Gmail.Users.Settings.Filters.remove('me', id);
});
};
const deleteGmailDrafts = () => {
GmailApp.getDrafts().forEach((draft) => {
draft.deleteDraft();
});
};
Turn off vacation autoresponders, disables IMAP and POP access, removes all email signatures and disables email forwarding.
const resetGmailSettings = () => {
const { Settings } = Gmail.Users;
// Disable Out-of-office
Settings.updateVacation({ enableAutoReply: false }, 'me');
// Delete Gmail Signatures
const { sendAs } = Settings.SendAs.list('me');
sendAs.forEach(({ sendAsEmail }) => {
Settings.SendAs.update({ signature: '' }, 'me', sendAsEmail);
});
// Disable IMAP
Settings.updateImap({ enabled: false }, 'me');
// Disable POP
Settings.updatePop({ accessWindow: 'disabled' }, 'me');
// Disable Auto Forwarding
const { forwardingAddresses } = Settings.ForwardingAddresses.list('me');
forwardingAddresses.forEach(({ forwardingEmail }) => {
Settings.ForwardingAddresses.remove('me', forwardingEmail);
});
};
#gmail #archives #google apps script #mobile app