ArcGIS Pro 2.6 API Reference Guide
DeleteElements Method
Example 

ArcGIS.Desktop.Layouts Namespace > Layout Class : DeleteElements Method
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.
Deletes an array of elements on a page layout. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void DeleteElements( 
   Func<Element,bool> predicate
)
Public Sub DeleteElements( _
   ByVal predicate As Func(Of Element,Boolean) _
) 

Parameters

predicate
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Map has reached maximum graphics count limit of 4000 elements. One or more elements cannot be created.
Map has reached maximum graphics size limit of 10 MB. One or more elements cannot be created.
Example
//Delete multiple layout elements.

//Perform on the worker thread
await QueuedTask.Run(() =>
{
  layout.DeleteElements(item => item.Name.Contains("Clone"));
});
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

Layout Class
Layout Members