Last active
April 1, 2025 11:13
-
-
Save enkelmedia/a7d1a8980960350442cb444ed7c36bf5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Use at your own risk. Thanks to https://umbracare.net/blog/how-to-delete-umbraco-user-permanently/ for inspiration. | |
*/ | |
BEGIN TRAN | |
DECLARE @userId INT = ( | |
SELECT id | |
FROM [dbo].[umbracoUser] | |
WHERE userLogin = '[email protected]' | |
); | |
PRINT 'User ID: ' + CAST(@userId AS VARCHAR); | |
UPDATE [dbo].[umbracoContentVersion] | |
SET userId = -1 -- infoweaver admin | |
WHERE userId = @userId; | |
UPDATE [dbo].[umbracoNode] | |
SET nodeUser = -1 -- infoweaver admin | |
WHERE nodeUser = @userId; | |
UPDATE [dbo].[umbracoLog] | |
SET userId = -1 -- infoweaver admin | |
WHERE userId = @userId; | |
DELETE | |
FROM [dbo].[umbracoUser2UserGroup] | |
WHERE userId = @userId; | |
DELETE | |
FROM [dbo].[umbracoUserLogin] | |
WHERE userId = @userId; | |
DELETE | |
FROM [dbo].[umbracoUser2NodeNotify] | |
WHERE userId = @userId; | |
DELETE | |
FROM [dbo].[umbracoUserStartNode] | |
WHERE userId = @userId; | |
DELETE | |
FROM [dbo].[umbracoUser] | |
WHERE id = @userId; | |
ROLLBACK TRAN | |
--COMMIT TRAN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment