---
title: Uninstalling modules
related:
  - https://docs.kentico.com/k9/custom-development/creating-custom-modules/creating-installation-packages-for-modules.md
  - https://docs.kentico.com/k9/custom-development/creating-custom-modules/creating-installation-packages-for-modules/installing-modules-from-installation-packages.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

You can uninstall custom modules that were installed via [NuGet packages](https://docs.kentico.com/k9/custom-development/creating-custom-modules/creating-installation-packages-for-modules.md). The uninstallation removes all files and code libraries used by the module and all related database objects.

> **Note:** **Note**:
>
> - To uninstall modules, you need to open the project in Visual Studio – uninstallation cannot be performed on certain types of deployed and running websites (for example on Microsoft Azure).
> - You cannot uninstall modules that were transferred directly using the Kentico [export](https://docs.kentico.com/k9/deploying-websites/exporting-and-importing-sites/exporting-objects.md) and [import](https://docs.kentico.com/k9/deploying-websites/exporting-and-importing-sites/importing-a-site-or-objects.md) features.
> - You cannot directly downgrade modules to older versions. However, it is possible uninstall a module and then install a package with an older version.

To uninstall a custom module from a Kentico project, you need to:

1. Uninstall the module's NuGet package from the Kentico solution in Visual Studio
2. Open the website in a browser, which triggers automatic removal of the module's database objects

**Warning**: Uninstalling a module deletes all [web parts](https://docs.kentico.com/k9/custom-development/developing-web-parts.md), [form controls](https://docs.kentico.com/k9/custom-development/developing-form-controls.md) and [page types](https://docs.kentico.com/k9/developing-websites/defining-website-content-structure/page-types.md) that are part of the module. If the site contains pages of the given type or page templates and forms that use the given components, the module uninstallation may cause errors or missing content on the site. Make sure that you replace or remove all occurrences of the given web parts, form controls and page types.

## Uninstalling the module package from the Kentico solution

> **Info:** **Uninstalling modules on web farms**
>
> If your application is running in a [web farm environment](https://docs.kentico.com/k9/configuring-kentico/optimizing-website-performance/setting-up-web-farms.md), you need to uninstall the module package from the Kentico project for _**each**_ web farm server.

1. Open the Kentico solution file in Visual Studio (using the _WebApp.sln_ file).
2. Right-click the **CMSApp** (web application) or **CMS** (web site) project in the Solution Explorer and select **Manage NuGet Packages**.
3. Uninstall the module package:
   - Visual Studio 2012/2013: Open the **Installed packages** tab of the _Manage NuGet Packages_ window, click **Uninstall** next to the module package.
   - Visual Studio 2015: Find the module package (you can use the _Installed_ filter), select the _Uninstall_ action and click **Uninstall**.
4. On web application projects, you need to **Clean** and then **Build** the Kentico solution (to ensure that any module assemblies are removed from the project's _bin_ folder).

All of the module's files and libraries are now removed from the Kentico project.

## Removing the module's database objects

To finish the module uninstallation, _**open your Kentico application in a browser**_. During the processing of the first request after you uninstalled the module package in Visual Studio, the system automatically removes the module's database objects.

> **Tip:** **Tip:** You can uninstall multiple custom modules from the Kentico solution, and then perform the removal of the database objects using a single request.

You can verify that the module was uninstalled successfully in the **Event log** application – confirm that the log contains an event with the **MODULEUNINSTALLED** code (_ModuleInstaller_ as the source) and no related errors. View the event details () for information about the modules that were uninstalled.
