ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Core Namespace / FavoritesManager Class / RemoveFavorite Method
The item to remove from the favorite collection. For example a folder connection or a toolbox.
Example Version

RemoveFavorite Method
Removes an item from the favorites collection.
Syntax
public void RemoveFavorite( 
   Item item
)

Parameters

item
The item to remove from the favorite collection. For example a folder connection or a toolbox.
Example
Remove All Favorites
var favorites = FavoritesManager.Current.GetFavorites();
foreach (var favorite in favorites)
  FavoritesManager.Current.RemoveFavorite(favorite.Item);
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also