Home » Blog » How to Clear the Microsoft Teams Cache

How to Clear the Microsoft Teams Cache

How to clear the Microsoft Teams cache

For some issues, it can be helpful to clear the MS Teams cache. For example, it is useful to empty the Microsoft Teams cache when applications or chat issues occur in the native Teams app that cannot be reproduced in the Teams browser app – an indication that the cause may be in the native app cache.

A common error that can often be fixed by clearing the cache in Microsoft Teams: when a static tab does not display any content, but loads an empty page. Sporadically, problems with Teams’ telephony feature can also be solved by deleting the Microsoft Teams cache.

Unfortunately, Microsoft has not yet implemented a user-friendly way to clear the cache by the click of a button.

With the release of the latest Microsoft Teams client there are now two distinct versions of Microsoft Teams, where each version requires a different approach to cache clearing, depending on its specific file structure and functionality. This section will guide you through the steps for both versions, ensuring you can efficiently resolve issues by clearing the cache, regardless of which version you’re using.

If you’re looking for instructions on how to clear the Microsoft Teams cache on Windows, be sure to check out our guide for macOS users.

Facing frequent Teams challenges?

Download free ebook on Microsoft Teams governance!

Delete Content Manually from Subfolders in Classic Teams

One way to empty the Teams cache is to go to the [user]\%appdata%\Microsoft\teams folder in Windows Explorer and delete the contents in eight of the subfolders. (You need to quit Teams before doing this.) These are the subfolders you need to empty:

  • cache
  • code cache
  • blob_storage
  • databases
  • GPUcache
  • IndexedDB
  • local storage
  • tmp
Alternative management tool for Microsoft Teams

Delete Teams Cache with a PowerShell Script in Classic Teams

Another easier method is to use a PowerShell script that we prepared for you, instead of navigating to all the cache folders individually and deleting the contents there.

Simply open the PowerShell app (installed by default in current Windows versions), copy and paste the following PowerShell script, press Enter and then restart your computer.

(The script will automatically quit and re-start Microsoft Teams for you).

Write-Host "Microsoft Teams will be quit now in order to clear the cache."
try{
Get-Process -ProcessName Teams | Stop-Process -Force
Start-Sleep -Seconds 5
Write-Host "Microsoft Teams has been successfully quit."
}
catch{
echo $_
}
# The cache is now being cleared.
try{
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\code cache\cache" | Remove-Item
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\blob_storage" | Remove-Item
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\databases" | Remove-Item
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\cache" | Remove-Item
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\gpucache" | Remove-Item
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\Indexeddb" | Remove-Item
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\Local Storage" | Remove-Item
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\tmp" | Remove-Item
 
}
catch{
echo $_
}
 
write-host "The Microsoft Teams cache has been successfully cleared."

Ready to simplify your Teams admin tasks?

Clear Teams Cache in New Teams

Transitioning from the Classic Teams to the New Teams, you’ll find that the steps to clear the cache are fundamentally similar. However, the key difference lies in the locations of the folders where the cache is stored. Let’s explore how to navigate these differences for the New Teams version.

Delete Content Manually from Subfolders in New Teams

Go to the [user]\%appdata\local\Packages\MSTeams_8wekyb3d8bbwe\LocalCache\Microsoft\MSTeamsfolder in Windows Explorer and delete the contents in all of the subfolders:

  • cache
  • code cache
  • blob_storage
  • databases
  • GPUcache
  • IndexedDB
  • local storage
  • tmp

(Don’t forget to quit the app before doing this.)

Delete Teams Cache with a PowerShell Script in New Teams

You can also use our PowerShell script to automatize the process. Copy and paste the following PowerShell script in the app, press Enter and restart your computer.

$clearCache = Read-Host "Delete the Teams Cache (Y/N)?"

if ($clearCache.ToUpper() -eq "Y"){
  Write-Host "Closing Teams" -ForegroundColor Cyan
  
  try{
    if (Get-Process -ProcessName ms-teams -ErrorAction SilentlyContinue) { 
        Stop-Process -Name ms-teams -Force
        Start-Sleep -Seconds 3
        Write-Host "Teams has been closed successfully" -ForegroundColor Green
    }else{
        Write-Host "Teams is already closed" -ForegroundColor Green
    }
  }catch{
      Write-Warning $_
  }

  Write-Host "Starting the process of clearing the Teams cache" -ForegroundColor Cyan

  
  try{
    Remove-Item -Path "$env:LOCALAPPDATA\Packages\MSTeams_8wekyb3d8bbwe" -Recurse -Force -Confirm:$false
    Write-Host "Teams cache has been deleted" -ForegroundColor Green
  }catch{
    Write-Warning $_
  }

  Write-Host "Teams cache deleted... Launching Teams" -ForegroundColor Green
  Start-Process -FilePath "C:\Program Files\WindowsApps\MSTeams_23335.219.2592.8659_x64__8wekyb3d8bbwe\ms-teams.exe"
}

Reset the New Teams App

In addition to the manual and script-based methods, the New Teams version introduces a new option to clear the cache by resetting the app.

For that, open the Settings app and go to “Apps” > “Installed apps” and search for “Microsoft Teams.” Find the New Microsoft Teams app, click the three dots (…) on the right, and select “Advanced options.” In the “Reset” section, click “Reset,” and finally, restart Teams.

Please note, that when you clear the cache in Microsoft Teams, be aware that some settings may temporarily revert to defaults. This includes device preferences such as the microphone, speaker, or camera, which might reset to default until Teams re-detects the preferred devices—a common occurrence if device IDs must be re-identified during app reload. Additionally, while custom backgrounds typically are not lost, there may be instances where Teams starts with a default background, like no background or a blurred effect, as it reloads these settings from its servers. You will also need to log in again since clearing the cache removes session data, a security step to protect your information. These changes are usually temporary, with original settings restored once the app has fully reinitialized and synced. Make sure to check and adjust your settings if necessary after clearing the cache.

While this script can help with cache issues, managing Teams involves many other challenges. For more options to keep control of Microsoft Teams, have a look at our Teams Manager – your powerful governance tool for Microsoft Teams management with a request and approval process for new teams, lifecycle management, naming convention, governance policies and more.

Linkedin Logo

Learn more about Microsoft Teams: Click here to follow us on Linkedin!

Comments
  • This only seems to delete the cache for the user that is activating the script, so, if you run this as an admin on another computer, you will just delete your admins-cache but not from the user..

    • Hello,
      you are right. The script presented here is to delete the client from the computer on which the user is working.
      Regards, Solutions2Share

  • This deletes all the users custom background and also user settings
    Run this on a few users device for testing and they all reported that the custom backgrounds are gone and some had the dark mode turned on and now that is no longer the settings that they set and 80% reported that the audio settings was back to the Device and not the headphones or audio settings they had before the script was run

    • Hey,

      that’s correct. Thank you for your comments, we will include the information in our blog post so that other users are also informed.

      Best regards
      Solutions2Share

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright 2021 © Solutions2Share GmbH

Terms and conditions Privacy policy Cookie Policy Imprint

Send this to a friend