How to Add Exceptions to Xiaomi Memory Cleanup: The Complete Guide

Automated memory cleaning on Xiaomi, Redmi and POCO smartphones is a useful feature that frees up space from unnecessary debris. But sometimes it removes important files, app cache, or even photos. To avoid this, you need to properly configure the exceptions to clean. In this article, we will examine everything from standard MIUI settings to hidden capabilities for power users.

Many people have a problem when they're clearing the memory, when they lose their browser passwords, game data, or even work documents, and the reason is that the system doesn't distinguish between junk and what you really want to do. Fortunately, MIUI allows you to add apps and folders to exceptions, but not everyone knows where to look for those settings, and we'll show you how to do that across different versions of firmware and models.

If you're using the Xiaomi 12T Pro, Redmi Note 11 or older devices like the POCO F3, the instruction is for everyone, the only difference is the location of some menu items โ€” we'll show you alternative paths, and we'll also look at what to do if the standard settings don't work, and how to get around the restrictions through ADB or third-party utilities.

Why Xiaomi Deletes Files When Cleaning Up

The MIUI memory cleanup function works on predefined algorithms. It analyzes:

  • ๐Ÿ—‘๏ธ Application cache (including game and instant messenger data)
  • ๐Ÿ“ Temporary files (for example, downloads from the browser)
  • ๐Ÿ“ธ Photo and video miniatures
  • ๐ŸŽฎ Game cache files (can delete saves!)

The problem is that the system doesnโ€™t always correctly determine which data is critical to the user, for example, Telegram cache can contain important documents, and temporary Chrome files can contain saved passwords.

Another reason is aggressive memory optimization on budget models (e.g. Redmi 9A or POCO M3), where cleaning is run more often to make room for system processes, and user data is affected as a result.

On devices with MIUI 14+ The cleaning algorithm has changed: the system can now delete files older 30 days, even if they're not cache, DCIM/Thumbs and some parts of internal memory.

Method 1: Add exceptions through standard MIUI settings

The easiest method is to use built-in tools, and the instructions are relevant for MIUI 12-14 (including global and Chinese versions):

  1. Open Settings โ†’ Memory โ†’ Clean Memory.
  2. Stick to three points (โ‹ฎ) in the upper right corner and select Cleaning Settings.
  3. Go to the Exclusions section (or Secure Applications on some firmware).
  4. Add the desired applications to the list by ticking the boxes.

On some models (e.g. Xiaomi 13 Lite), the path may be different: Settings โ†’ Applications โ†’ App Management โ†’ Cleanup โ†’ Exceptions.

โš ๏ธ Note: Standard exceptions only work for applications, not for individual files or folders. If you need to save specific data (such as a folder with photos), use Method 2 or 3.

โ˜‘๏ธ What can be added to exceptions through settings

0

๐Ÿ“ฑ Applications (e.g. Telegram, WhatsApp, games)

๐ŸŽต Music players (save cache of songs)

๐Ÿ“ท Gallery (to protect thumbnails and temporary files)

๐ŸŒ Browsers (will save history and passwords)

Method 2: Exclude folders through file manager

If you need to protect specific folders (such as working documents or backups), use the built-in File Manager (or Files by Google):

  1. Open the File Manager and find the folder you want to protect.
  2. Long tap on the folder โ†’ Properties (or โ‹ฎ โ†’ Additionally).
  3. Choose Protect from Cleaning or Add to Exceptions.
  4. Confirm the action (a password or fingerprint may be required).

On POCO X3 Pro and other MIUI devices for POCO, this item may be called Excluded from Optimization.

Xiaomi modelThe Way to Exception SettingsDoes the folder exclusion support
Xiaomi 14 UltraSettings โ†’ Memory โ†’ Cleaning โ†’ ExceptionsYes (MIUI 14.0.5+)
Redmi Note 12 Pro+Settings โ†’ Applications โ†’ Cleaning โ†’ ProtectedOnly apps.
POCO F5Settings โ†’ System โ†’ Memory โ†’ SettingsYes (via file manager)
Xiaomi 11TSecurity โ†’ Cleanup โ†’ โ‹ฎ โ†’ ExceptionsPartially (system folders only)

๐Ÿ’ก

If the file manager doesn't have the option, rename the folder by adding an underline symbol ( ) at the beginning, such as: Important documents, which will reduce the likelihood of it being deleted when you automatically clean it.

Method 3: Using ADB for Extended Exceptions

For power users, there's a method through Android Debug Bridge (ADB), which allows you to add exceptions to files that aren't visible in the standard settings.

  • ๐Ÿ–ฅ๏ธ A computer with installed Xiaomi drivers and ADB
  • ๐Ÿ“ฑ Included debugging by USB smartphone
  • ๐Ÿ”Œ Cable USB (preferably original)

Instructions:

  1. Connect your phone to your PC and start the command line (cmd).
  2. Enter the command to check the connection: Adb devices should appear the name of your device.
  3. Add folder to exceptions (example for Download folder): adb shell cmd storage exclude-add /storage/emulated/0/Download
  4. Check the exclusion list: adb shell cmd storage exclude-list

โš ๏ธ Attention: Misuse of the right ADB It can cause system failures. Don't add system folders to exceptions (/system, /data), If you are not sure of your actions.

How to Reverse Exclusions Through ADB

Use the command:

adb shell cmd storage exclude-remove /path/to/folder

For example, for the Download folder:

adb shell cmd storage exclude-remove /storage/emulated/0/Download

Method 4: Third-party applications for cleaning management

If the standard methods don't work, you can use utilities from Google Play.

  • ๐Ÿ›ก๏ธ SD Maid, which allows you to manually choose what to clean and what not to clean, supports the creation of whitelists".
  • ๐Ÿงน Files by Google โ€“ has an inbuilt exception feature for folders.
  • ๐Ÿ” Storage Analyzer โ€“ shows which files are taking up space and allows you to protect them.

Example of settings in SD Maid:

  1. Open the app and go to the CorpseFinder section.
  2. Slap the icon. โš™๏ธ (setting) โ†’ Exceptions.
  3. Add paths to folders or files that donโ€™t need to be cleaned.
  4. Save the changes and start the analysis.

๐Ÿ“Š What app do you use to clean your memory?
MIUI Cleaner (built-in)
SD Maid
Files by Google
CCleaner
Other
I don't use it.

Frequent Mistakes and How to Avoid Them

Many users make the same mistakes when setting exceptions:

  • ๐Ÿšซ Add system folders to exceptions (for example, /Android/data), resulting in failure.
  • ๐Ÿšซ Forget to update the exception list after resetting settings.
  • ๐Ÿšซ Use Cyrillic characters in the names of protected folders (it is better to use the Latin alphabet or accents).

Another common problem is that exceptions are reset after the MIUI update.

  1. Before updating, make a backup of the exception list (you can take a picture of the screen).
  2. After the update, check the settings in Settings โ†’ Memory โ†’ Cleanup โ†’ Exceptions.
  3. If the exceptions are gone, add them again.

๐Ÿ’ก

Check the exception list regularly after MIUI updates โ€“ they are often reset to standard values.

Additional information on data protection

Apart from exceptions, there are other ways to save important files:

  • ๐Ÿ”„ Backup: Use Mi Cloud or Google Drive to Automatically Backup Photos and Documents.
  • ๐Ÿ“ Hidden folders: Rename important folders by adding a point to the beginning (e.g,.secret_files). They will not be displayed in a standard conductor.
  • ๐Ÿ” Password archives: Archive critical data in.zip or.rar with password.

For root-enabled device owners, there is another way to change folder permissions through chmod, such as making the folder uncleanable:

su


chmod 700 /sdcard/ Important folder

โš ๏ธ Warning: Changing the permissions of the system folders can cause the device to run in an unstable way. Use this method only if you know exactly what you're doing.

FAQ: Frequent questions about Xiaomi cleanup exceptions

Can you add cloud folders (Google Drive, Mi Cloud) to the exceptions?
No, standard MIUI settings don't allow you to add cloud storage to exceptions, but you can manually download important files to your device and protect them through a file manager.
Why are files deleted after adding to the exception?
Probable reasons: You added an app to the exceptions, but not its cache (they are cleaned separately). Use a third-party cleaner (such as CCleaner) that ignores the MIUI settings. The device has enabled Deep Clean (turn it off in the memory settings).
How to protect game saves from removal?
Most games are stored in a folder. /Android/data/To protect them, find the game folder through the file manager. copy it to another location (e.g, /sdcard/Games_Saves). Add a new folder to exceptions. For some games (like Genshin Impact), the saves are stored on the server - cleaning them is not scary.
Do exceptions work on custom firmware devices (like LineageOS)?
No, the exception feature is unique to MIUI: On custom firmware, use third-party utilities like SD Maid or set up manual cleaning.
Can automatic cleaning be completely shut down?
Yes, but it's not recommended, because over time, the device will start to slow down. To turn off: Go to Settings โ†’ Memory โ†’ Memory Cleanup. Turn off Auto Cleanup. In the Cleanup Settings section, uncheck Auto Optimization. On some firmware (e.g., MIUI for POCO), this option may be called Smart Cleanup.