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):
- Open Settings โ Memory โ Clean Memory.
- Stick to three points (โฎ) in the upper right corner and select Cleaning Settings.
- Go to the Exclusions section (or Secure Applications on some firmware).
- 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):
- Open the File Manager and find the folder you want to protect.
- Long tap on the folder โ Properties (or โฎ โ Additionally).
- Choose Protect from Cleaning or Add to Exceptions.
- 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 model | The Way to Exception Settings | Does the folder exclusion support |
|---|---|---|
| Xiaomi 14 Ultra | Settings โ Memory โ Cleaning โ Exceptions | Yes (MIUI 14.0.5+) |
| Redmi Note 12 Pro+ | Settings โ Applications โ Cleaning โ Protected | Only apps. |
| POCO F5 | Settings โ System โ Memory โ Settings | Yes (via file manager) |
| Xiaomi 11T | Security โ Cleanup โ โฎ โ Exceptions | Partially (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:
- Connect your phone to your PC and start the command line (cmd).
- Enter the command to check the connection: Adb devices should appear the name of your device.
- Add folder to exceptions (example for Download folder): adb shell cmd storage exclude-add /storage/emulated/0/Download
- 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/folderFor example, for the Download folder:
adb shell cmd storage exclude-remove /storage/emulated/0/DownloadMethod 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:
- Open the app and go to the CorpseFinder section.
- Slap the icon. โ๏ธ (setting) โ Exceptions.
- Add paths to folders or files that donโt need to be cleaned.
- Save the changes and start the analysis.
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.
- Before updating, make a backup of the exception list (you can take a picture of the screen).
- After the update, check the settings in Settings โ Memory โ Cleanup โ Exceptions.
- 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.