> ## 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.

# Maintenance

> MainWP Maintenance helps you remove revisions, comments, empty taxonomies, and transients, then run scheduled cleanup across selected child sites.

## What You'll Learn

* Available cleanup tasks in MainWP Maintenance
* Running maintenance for selected sites, tags, or clients
* Creating and managing recurring maintenance schedules
* What remains from the legacy 404 email alerts feature

## Prerequisites

* MainWP Maintenance Extension is installed and activated.
* You have connected MainWP Child sites.
* You have a recent database backup for the sites you plan to maintain.

***

<div id="addon-data" style={{display: 'none'}} data-title="Maintenance" data-purchase-url="https://mainwp.com/extension/maintenance/" data-pricing-tier="pro" data-bundle="MainWP Pro" data-addon-type="extension" data-version="5.1.1" data-developer="MainWP" data-changelog-url="https://mainwp.com/changelog/mainwp-maintenance-extension/" data-video-url="https://www.youtube.com/watch?v=NEf40nFQ3v4" data-owned-by="Jestart LLC" data-privacy-url="https://mainwp.com/mainwp-plugin-privacy-policy/" />

<Info>
  **Extension Add-on** - This add-on provides standalone functionality within MainWP Dashboard. No third-party plugins are required.
</Info>

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/NEf40nFQ3v4" title="Maintenance - Video Tutorial" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

[MainWP Maintenance Extension](https://mainwp.com/extension/maintenance/) lets you clean and optimize child site databases without logging in to each site separately. You can remove revisions, drafts, trash content, comments, empty taxonomies, and transients, then run database optimization from one place in MainWP Dashboard.

<Warning>
  Create a database backup before you run maintenance. Database optimization and deleting all transients can temporarily affect performance while cached data is rebuilt.
</Warning>

## Maintenance Options

MainWP Maintenance groups cleanup actions into the following sections:

### Content Cleanup

* Delete all post revisions
* Delete all auto draft posts
* Delete trash posts
* Use **Except for the last** to keep the newest revisions. Enter `0` to delete all revisions.

### Comment Cleanup

* Delete spam comments
* Delete pending comments
* Delete trash comments

### Taxonomy Cleanup

* Delete tags with 0 posts associated
* Delete categories with 0 posts associated

### Database Optimization

* Optimize database tables

### Transient Cleanup

* **Don't Delete Transients**
* **Expired transients**
* **All Transients**

Selecting **All Transients** shows an additional warning because some plugins may briefly regenerate cached data after the cleanup completes.

## Run Maintenance

<img src="https://mintcdn.com/mainwp/lPwltJZFM8L4Eb3e/images/add-ons/maintenance-main-tab.png?fit=max&auto=format&n=lPwltJZFM8L4Eb3e&q=85&s=6b2eb4acd07f60ac769794a49220e6df" alt="MainWP Maintenance main tab showing cleanup options, transient cleanup, and the Select Sites accordion" width="3840" height="2598" data-path="images/add-ons/maintenance-main-tab.png" />

<Steps>
  <Step title="Open the Maintenance page">
    Go to **MainWP > Add-ons > Maintenance** and stay on the **Maintenance** tab.
  </Step>

  <Step title="Choose the cleanup tasks">
    Select the maintenance options you want to run. If you enable **Delete all post revisions**, set **Except for the last** to the number of revisions you want to keep.
  </Step>

  <Step title="Choose a transient cleanup mode">
    In **Transient Cleanup**, choose whether you want to skip transients, delete only expired transients, or delete all transients.
  </Step>

  <Step title="Select the child sites">
    Use the **Select Sites** accordion to choose targets by **Sites**, **Tags**, or **Clients**.
  </Step>

  <Step title="Run the task">
    Click **Run Maintenance**, then confirm any warnings for database optimization or deleting all transients.
  </Step>
</Steps>

MainWP displays a progress window while the selected tasks run on each child site.

## Schedule Maintenance

<img src="https://mintcdn.com/mainwp/lPwltJZFM8L4Eb3e/images/add-ons/maintenance-create-new-schedule.png?fit=max&auto=format&n=lPwltJZFM8L4Eb3e&q=85&s=8b1f18e112539daf75ffb4c2d048e836" alt="MainWP Maintenance create new schedule screen with schedule options, maintenance tasks, and site selection" width="3832" height="1956" data-path="images/add-ons/maintenance-create-new-schedule.png" />

<Steps>
  <Step title="Open the schedule screen">
    Go to **MainWP > Add-ons > Maintenance > Schedules**, then click **Create New Schedule**.
  </Step>

  <Step title="Configure the schedule options">
    Enter a **Schedule title**, then choose how many times the task should run per **Day**, **Week**, **Month**, or **Year**.
  </Step>

  <Step title="Choose the run day and hour when needed">
    Schedules use your MainWP Dashboard timezone. For weekly, monthly, and yearly schedules that run once per period, choose the run day and hour in **Schedule Options**.
  </Step>

  <Step title="Choose the maintenance tasks">
    Select the cleanup options, revision retention value, and transient cleanup mode you want the schedule to use.
  </Step>

  <Step title="Select the targets">
    In the **Select Sites** accordion, choose child sites by **Sites**, **Tags**, or **Clients**.
  </Step>

  <Step title="Save the schedule">
    Click **Schedule Maintenance**.
  </Step>
</Steps>

## Manage Scheduled Tasks

The **Schedules** table lists each task with its title, schedule, **Last Run**, and **Next Run**. The run columns are shown as relative times, and the exact timestamps appear in the tooltips.

<img src="https://mintcdn.com/mainwp/lPwltJZFM8L4Eb3e/images/add-ons/maintenance-edit-and-delete-scheduled-jobs.png?fit=max&auto=format&n=lPwltJZFM8L4Eb3e&q=85&s=2a41aa715fdbaf4b0d716eef6f3609ee" alt="MainWP Maintenance schedules table showing the ellipsis action menu for running, editing, and deleting scheduled jobs" width="3296" height="996" data-path="images/add-ons/maintenance-edit-and-delete-scheduled-jobs.png" />

<Steps>
  <Step title="Open the action menu">
    In the **Schedules** table, use the ellipsis menu on the right side of the schedule row.
  </Step>

  <Step title="Run a schedule immediately">
    Choose **Run Now** to execute the saved maintenance task on demand.
  </Step>

  <Step title="Edit a schedule">
    Choose **Edit**, update the schedule or maintenance options, and click **Save Changes**.
  </Step>

  <Step title="Delete a schedule">
    Choose **Delete** to remove the saved maintenance task.
  </Step>
</Steps>

## 404 Email Alerts (Legacy)

#### **Feature retired for new users since version 4.1**

The legacy **404 Email Alerts** feature is no longer part of the standard Maintenance workflow for new installations. Current Maintenance documentation focuses on database cleanup and scheduled maintenance tasks.

If you already use an older setup that still exposes 404 alerts, you can continue managing the notification email address and selected sites from that legacy screen.

***

## Related Resources

* [Performance Add-ons](/add-ons/performance) - Browse all performance tools
* [Database Updater](/add-ons/updates/mainwp-database-updater-extension) - Database update management
* [Advanced Uptime Monitor](/add-ons/monitoring/advanced-uptime-monitor-extension) - Monitor site uptime
