DeleteObject[obj]
deletes the object obj.
DeleteObject[{obj1,obj2,…}]
deletes all the obji.


DeleteObject
DeleteObject[obj]
deletes the object obj.
DeleteObject[{obj1,obj2,…}]
deletes all the obji.
Details

- DeleteObject returns Null if it succeeds in deleting all given objects, and $Failed otherwise.
- DeleteObject works on objects such as CloudObject, LocalObject, PersistentObject, ResourceObject, ExternalSessionObject and ServiceObject.
- DeleteObject deletes files and directories without asking for confirmation.
Examples
open all close allScope (12)
Remove all persistent objects with a given key on $ContextPath:
Remove all persistent objects of a given persistence location:
Create a directory cloud object:
Add something to the directory:
Remove the directory cloud object and its contents:
Create, cache and use a data resource object:
Retrieve a resource from the public data repository:
Remove the local cache of the resource:
Start listening on an available socket, applying a handler function to events:
Create and then remove a permissions group:
Remove permissions keys from any cloud objects that are using them:
Use Once for a form of dynamic programming, using a custom location to cache the values computed:
Find the number of cached values generated:
Remove the cached values before redoing the timing experiment by deleting the custom persistence location:
Properties & Relations (3)
Symbols and local symbols are removed with Remove:
Files are deleted with DeleteFile:
In contrast to the default behavior of DeleteDirectory, DeleteObject deletes cloud directories even if they contain other objects:

See Also
DeleteFile DeleteDirectory Remove WithCleanup
Function Repository: ScheduleCloudObjectExpiration
Related Workflows
- Find All Initializations
Text
Wolfram Research (2017), DeleteObject, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteObject.html (updated 2025).
CMS
Wolfram Language. 2017. "DeleteObject." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/DeleteObject.html.
APA
Wolfram Language. (2017). DeleteObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeleteObject.html
BibTeX
@misc{reference.wolfram_2025_deleteobject, author="Wolfram Research", title="{DeleteObject}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/DeleteObject.html}", note=[Accessed: 14-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_deleteobject, organization={Wolfram Research}, title={DeleteObject}, year={2025}, url={https://reference.wolfram.com/language/ref/DeleteObject.html}, note=[Accessed: 14-August-2025]}