DeleteObject
Details

- DeleteObject returns Null if it succeeds in deleting all given objects, and $Failed otherwise.
- DeleteObject works on CloudObject, LocalObject, PersistentObject, PersistenceLocation, ResourceObject, Databin, ChannelObject, ExternalSessionObject, SocketListener, PermissionsGroup and PermissionsKey.
- DeleteObject deletes files and directories without asking for confirmation.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (12)Survey of the scope of standard use cases

https://wolfram.com/xid/0bdplbrma-xcve0s


https://wolfram.com/xid/0bdplbrma-lyx2b4

https://wolfram.com/xid/0bdplbrma-yua945

https://wolfram.com/xid/0bdplbrma-ipgx23
Remove all persistent objects with a given key on $ContextPath:

https://wolfram.com/xid/0bdplbrma-lv8ger
Remove all persistent objects of a given persistence location:

https://wolfram.com/xid/0bdplbrma-f17ghh

https://wolfram.com/xid/0bdplbrma-elav3


https://wolfram.com/xid/0bdplbrma-fuja6h
Create a directory cloud object:

https://wolfram.com/xid/0bdplbrma-b8ymcl

Add something to the directory:

https://wolfram.com/xid/0bdplbrma-bmxmbn

Remove the directory cloud object and its contents:

https://wolfram.com/xid/0bdplbrma-iidl3j

https://wolfram.com/xid/0bdplbrma-dtly0n


https://wolfram.com/xid/0bdplbrma-elp752

https://wolfram.com/xid/0bdplbrma-l4f2r6


https://wolfram.com/xid/0bdplbrma-jtttft
Create, cache and use a data resource object:

https://wolfram.com/xid/0bdplbrma-krzw9e


https://wolfram.com/xid/0bdplbrma-tqwu7


https://wolfram.com/xid/0bdplbrma-f5xypp


https://wolfram.com/xid/0bdplbrma-j4zkp
Retrieve a resource from the public data repository:

https://wolfram.com/xid/0bdplbrma-kphvpj

Remove the local cache of the resource:

https://wolfram.com/xid/0bdplbrma-cam6p6

https://wolfram.com/xid/0bdplbrma-se3s41


https://wolfram.com/xid/0bdplbrma-ii68e1
Start listening on an available socket, applying a handler function to events:

https://wolfram.com/xid/0bdplbrma-5ta6sf


https://wolfram.com/xid/0bdplbrma-hte1ty
Create and then remove a permissions group:

https://wolfram.com/xid/0bdplbrma-eq7huy


https://wolfram.com/xid/0bdplbrma-bh944x
Remove permissions keys from any cloud objects that are using them:

https://wolfram.com/xid/0bdplbrma-ehhx3


https://wolfram.com/xid/0bdplbrma-dpu7z4
Use Once for a form of dynamic programming, using a custom location to cache the values computed:

https://wolfram.com/xid/0bdplbrma-0mfig3

https://wolfram.com/xid/0bdplbrma-xq3ln4

Find the number of cached values generated:

https://wolfram.com/xid/0bdplbrma-jhzag3

Remove the cached values before redoing the timing experiment by deleting the custom persistence location:

https://wolfram.com/xid/0bdplbrma-upy5eb
Properties & Relations (3)Properties of the function, and connections to other functions
Symbols and local symbols are removed with Remove:

https://wolfram.com/xid/0bdplbrma-zm2qs3

https://wolfram.com/xid/0bdplbrma-q73hgo

https://wolfram.com/xid/0bdplbrma-ea7w1f
Files are deleted with DeleteFile:

https://wolfram.com/xid/0bdplbrma-voo2yt


https://wolfram.com/xid/0bdplbrma-wzf92u

https://wolfram.com/xid/0bdplbrma-sp6l9l
In contrast to the default behavior of DeleteDirectory, DeleteObject deletes cloud directories even if they contain other objects:

https://wolfram.com/xid/0bdplbrma-5kgh9t


https://wolfram.com/xid/0bdplbrma-ddxsvc



https://wolfram.com/xid/0bdplbrma-hblnqi

https://wolfram.com/xid/0bdplbrma-e7obll

Wolfram Research (2017), DeleteObject, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteObject.html.
Text
Wolfram Research (2017), DeleteObject, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteObject.html.
Wolfram Research (2017), DeleteObject, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteObject.html.
CMS
Wolfram Language. 2017. "DeleteObject." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DeleteObject.html.
Wolfram Language. 2017. "DeleteObject." Wolfram Language & System Documentation Center. Wolfram Research. 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
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="2017", howpublished="\url{https://reference.wolfram.com/language/ref/DeleteObject.html}", note=[Accessed: 12-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_deleteobject, organization={Wolfram Research}, title={DeleteObject}, year={2017}, url={https://reference.wolfram.com/language/ref/DeleteObject.html}, note=[Accessed: 12-May-2025
]}