> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mainwp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to delete MainWP related content from a Child Site database

> Remove all MainWP Child plugin data from a child site database using SQL commands in phpMyAdmin. Always backup your database before running these commands.

If you need to completely remove all MainWP Child plugin data from a child site's database, you can do so using SQL commands. This is useful when decommissioning a site or troubleshooting connection issues.

## What You'll Learn

* How to remove MainWP data from the database
* When to use this procedure

## Prerequisites

* Access to phpMyAdmin or similar database tool
* Database backup completed

> [!WARNING]
>
> **Back up your database before proceeding.** These commands permanently delete data and cannot be undone.

***

## When to Use This

Use this procedure when:

* Completely removing MainWP from a child site
* Troubleshooting persistent connection issues
* Resetting a site to reconnect with a new Dashboard
* Decommissioning a child site

***

## Delete MainWP Data

**1. Back up your database**

Create a full database backup before making any changes.

**2. Access phpMyAdmin**

Log in to your child site's cPanel, Plesk, or hosting control panel and open phpMyAdmin (or a similar database management tool).

**3. Select the database**

Navigate to and select the database for your child site.

**4. Open SQL tab**

Click on the **SQL** tab to enter custom queries.

**5. Run the delete command**

Paste and execute this SQL command:

```sql theme={null}
DELETE FROM `wp_options` WHERE option_name LIKE '%mainwp_%'
```

> [!NOTE]
>
> If your WordPress installation uses a custom table prefix (not `wp_`), replace `wp_options` with your actual prefix (e.g., `custom_options`).

**6. Execute the query**

Click **Go** to run the query. The command removes all MainWP-related entries from the options table.

***

## What Gets Deleted

This command removes:

| Data | Description |
| - | - |
| Connection keys | Encryption keys linking to Dashboard |
| Plugin settings | MainWP Child configuration |
| Cached data | Stored sync information |
| Unique Security ID | Site identification data |

***

## After Deletion

After removing the data:

1. **Deactivate and delete** the MainWP Child plugin if you're removing MainWP completely
2. **Reconnect the site** if you want to add it to a Dashboard again (you'll need to reinstall and configure the Child plugin)

***

## Self-Check Checklist

* [ ] Database backup created
* [ ] Correct database selected in phpMyAdmin
* [ ] Table prefix verified (wp\_ or custom)
* [ ] SQL command executed successfully
* [ ] MainWP Child plugin deactivated/deleted (if removing)

***

## Related Resources

* [Uninstall Child Reports Database](https://docs.mainwp.com/customization/how-to-uninstall-mainwp-child-reports-database.md) - Remove reporting data
* [Reconnecting Child Sites](https://docs.mainwp.com/getting-started/child-plugin-5-2-1-reconnecting-child-sites-with-unique-security-id.md) - Reconnection process
* [Move Child Sites to Another Dashboard](https://docs.mainwp.com/advanced/move-child-sites-to-another-mainwp-dashboard.md) - Migration guide


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.