Delete Module (Hard)
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens
Removes a module from a page permanently. It doesn't go to the Recycle Bin. If no other page shows the module, DNN deletes the module itself too.
A hard delete can't be undone. If this was the only page showing the module, the module is gone. Save its content first with Export Module Content if you might need it, or use Delete Module (Soft).
This action is part of the Portal Management add-on, which is installed and licensed separately (feature package PORTAL). If it isn't licensed, the action fails with a not-licensed error.
Typical Use Cases
- Clean up modules created for a temporary purpose, for example a test or a one-time form
- Remove a module from a page without leaving it in the Recycle Bin
- Remove one shared instance of a module from a page while other pages keep it
Don't use it to
- Remove a module you might want back. Use Delete Module (Soft) instead.
- Empty the Recycle Bin. Modules in the Recycle Bin can't be found by this action.
- Delete a whole page. Use Delete Page (Hard) instead.
Related Actions
| Action Name | Description |
|---|---|
| Delete Module (Soft) | Sends a module to the Recycle Bin instead. |
| Load Module | Checks that the module exists before you delete it. |
| Export Module Content | Saves a module's content before you delete it. |
| Add Module | Adds a new module to a page. |
| Delete Page (Hard) | Deletes a whole page permanently. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Page | The page that has the module. Pick a page, or use an expression that resolves to a Tab ID, a Tab Path such as //Customers//Acme, or a Tab Name (the first page with that name is used). Leave empty to use the current page. | Yes | Current page | No |
| Module Identifier | The module to delete, as a module ID or a module title. A title is matched without regard to case, and the first module on the page with that title is used. Modules in the Recycle Bin are skipped. | Yes | empty string | Yes |
Output Parameters Reference
This action doesn't produce any output tokens.
Soft or hard delete
| Delete Module (Soft) | Delete Module (Hard) | |
|---|---|---|
| What happens | The module instance is marked as deleted on this page | The module instance is removed from this page |
| Recycle Bin | Yes, it can be restored | No, it can't be restored |
| Module and content | Kept in the database | Removed by DNN when this was the last page showing the module |
| Shared instances on other pages | Not affected | Not affected |
Considerations
- Only this page is affected. If the module is shared on other pages (see Add Existing Module), those instances stay, and so does the module.
- A missing module isn't an error. If the page or module can't be found, the action does nothing. Nothing tells you whether a module was deleted.
- Use the module ID. Titles aren't unique, so a title can match a different module than you expect. With a hard delete, that mistake can't be undone.
- Guard against an empty identifier. An empty Module Identifier matches the first module on the page that has no title. Add a condition such as
[ModuleId] != "". - Tab IDs are used as given. A numeric Page value isn't checked against the current portal. Make sure the ID comes from a trusted source.
- Leaving Page empty needs a current page. In a scheduled workflow or an API call there's no current page, so the action fails with
Could not get current page. - There's no permission check in the action. Anyone who can run it can delete modules from any page. Only run it where trusted users can reach it, and add a condition as a second guard.
Examples
To understand how to use the below examples, please see Running Examples.
1. Delete a temporary module
This action permanently deletes the module in [TempModuleId] from the page in [TempPageId]. The condition makes sure a module ID is set.
{
"Title": "Delete Module (Hard)",
"ActionType": "DeleteModule",
"Description": "Delete the temporary module",
"Condition": "[TempModuleId] != \"\"",
"Parameters": {
"PageId": "[TempPageId]",
"ModuleId": "[TempModuleId]"
}
}
Revised 09/27/2026