Microsoft will retire the code snippets feature for Teams chats and channels. Users should use a code block as an alternative.

The retirement aims to streamline development efforts and enhance the overall user experience by focusing on code blocks, which provide a faster and more efficient way for users, particularly developers, to create, edit, and share code directly in the compose box without the need for a title. The title is a mandatory field of code snippets, on the other hand, code blocks have limitations with line numbers and readability.
It is important to note that while users will no longer be able to create new code snippets after the retirement date, all previously sent code snippets will remain accessible in Teams.
Timeline
- 30 May 2025: Users will no longer be able to create new code snippets.
- 16 June 2025: The code snippets feature will be fully retired.
This retirement applies to Teams for Windows, Teams for Mac, and Teams for the web. The code snippets feature (to create snippets) is not available on Teams Mobile.
Alternative solution for users
Microsoft encourages users to adopt code blocks as an alternative to the retired code snippets feature.

Code blocks have some benefits compared to code snippets:
- Faster and more efficient code sharing directly in the compose box.
- Upcoming support for line numbers, enhancing readability and organization.
- Upcoming support for accessibility on mobile devices, allowing collaboration from anywhere.
More information
- Send code snippets in a message in Microsoft Teams – Microsoft Support (will be retired)
- Use code blocks in Microsoft Teams – Microsoft Support (should be used as an alternative)