Is it possible to permanently delete a datastore?

Hello. I’ve had my plently share of datastores in my roblox games, and I’ve reached a certain wallblock when trying to delete datastores permanently, by that I mean deleting it entirely, getting rid of all keys and even from it displaying. I’m stuck at the “getting rid of itself” part though.

Random datastores that I wanted to wipe, since the game used to be mostly just a console playground back then.

1 Like

There might be a better method but you could run:

local dataStore = -- Insert datastore local allKeyPages = dataStore:ListKeysAsync() while allKeyPages.IsFinished == false do	local keyPage = allKeyPages:GetCurrentPage()	for key, value in keyPage do	local success, errorMessage = pcall(function()	dataStore:RemoveAsync(key)	end)	if not success then warn("Remove Async Fail!", errorMessage) end	task.wait(0.5) -- Prevent rate limit	end	allKeyPages:AdvanceToNextPageAysnc() end 

Reference:
Roblox Docs - DataStores - :ListKeysAsync()

1 Like

This works, but I have a datastore with 11k total keys and this just won’t do it. Around 20~ mins per 1k keys removed.

I’m not sure if there’s an easier solution but you can probably lower the wait a bit without getting rate limited. Maybe you can do 0.1 seconds.