Shop Cleaner

Overview

↑ Back to top

Shop Cleaner is a comprehensive WooCommerce store cleanup plugin. It helps you remove unwanted products, find and eliminate duplicate listings, clean orphaned media files, delete inactive customer accounts, and optimize your database — all from a single, modern interface integrated into WooCommerce settings.

Requirements:

  • WordPress 6.4 or higher
  • WooCommerce 8.0 or higher
  • PHP 7.4 or higher

Installation

↑ Back to top
  1. Download the plugin ZIP file from your WooCommerce.com account.
  2. In your WordPress admin, go to Plugins > Add New > Upload Plugin.
  3. Select the ZIP file and click Install Now.
  4. Click Activate Plugin.
  5. The plugin interface is available at WooCommerce > Settings > Advanced > Shop Cleaner.

Note: WooCommerce must be installed and activated before activating Shop Cleaner. If WooCommerce is not active, you will see an admin notice prompting you to install it.


Getting Started

↑ Back to top

After activation, navigate to WooCommerce > Settings > Advanced > Shop Cleaner. You will see a tabbed interface with seven sections:

  • Products — Filter and remove products
  • Duplicates — Find and remove duplicate products
  • Media — Detect and delete orphaned product images
  • Database — Optimize your WooCommerce database
  • Customers — Remove inactive customer accounts
  • Logs — View the history of all cleanup operations
  • Settings — Configure plugin behavior and scheduling

We recommend starting with the Settings tab to configure your preferences before running any cleanup operations.


Product Cleanup

↑ Back to top

The Products tab lets you filter your product catalog and remove matching products in batches.

Filtering Products

↑ Back to top

Use any combination of the following filters to narrow down which products to target:

FilterOptionsDescription
CategoryAny product categoryFilter by product category slug
Product TypeSimple, Variable, Grouped, ExternalFilter by WooCommerce product type
StatusPublished, Draft, Pending, PrivateFilter by post status
Stock StatusIn Stock, Out of Stock, On BackorderFilter by inventory status
Created BeforeDate pickerOnly include products created before this date
Min PriceNumeric valueOnly include products at or above this price
Max PriceNumeric valueOnly include products at or below this price
TagAny product tagFilter by product tag slug

Scanning

↑ Back to top

Click Scan to preview all products matching your filters. The preview table shows:

  • Product ID
  • Thumbnail image
  • Product name
  • SKU
  • Product type
  • Status
  • Stock status
  • Price
  • Creation date

Cleaning

↑ Back to top

After reviewing the scan results, choose an action:

  • Move to Trash — Moves products to the WordPress trash. They can be recovered from the trash at any time.
  • Delete Permanently — Permanently removes products. This action cannot be undone.

Products are processed in batches (configurable in Settings, default: 20). A progress indicator shows how many items have been processed.

Emptying Trash

↑ Back to top

Use the Empty Trash button to permanently delete all products currently in the WordPress trash.

Image Deletion

↑ Back to top

When the Delete images with products setting is enabled, featured images and gallery images associated with deleted products are also removed.


Duplicate Finder

↑ Back to top

The Duplicates tab helps you identify and remove duplicate product listings.

Detection Methods

↑ Back to top

Choose how duplicates are detected:

  • By SKU — Products with identical SKU values are grouped together.
  • By Title — Products with identical names are grouped together.
  • By Both — Products matching by either SKU or title are found and deduplicated.

Scanning for Duplicates

↑ Back to top

Click Scan for Duplicates to run the detection. Results are displayed as groups, with each group containing all products that match. For each product you can see:

  • Product ID
  • Product name
  • SKU
  • Product type
  • Status
  • Price
  • Creation date
  • Thumbnail image

The scan displays up to 200 duplicate groups.

Cleaning Duplicates

↑ Back to top

Configure cleanup options:

  • Keep — Choose to keep the oldest or newest product in each group (based on creation date). All other products in the group will be removed.
  • Action — Choose Move to Trash or Delete Permanently.

Click the cleanup button to process all duplicate groups at once.


Media Cleanup

↑ Back to top

The Media tab scans for orphaned product images and lets you remove them to recover storage space.

What Is an Orphaned Image?

↑ Back to top

An orphaned image is a media file that is attached to a product but is not currently used as:

  • The product’s featured image
  • An image in the product’s gallery

These images remain on your server and in your media library but serve no purpose.

Scanning for Orphaned Images

↑ Back to top

Click Scan for Orphaned Images. The results table shows:

  • Image ID
  • Thumbnail preview
  • Filename
  • File title
  • File size
  • Upload date

Deleting Orphaned Images

↑ Back to top

You can:

  • Delete All Orphaned — Remove all detected orphaned images at once.
  • Select individual images — Choose specific images to delete.

Deleted images are permanently removed from the media library and the server.


Database Cleanup

↑ Back to top

The Database tab provides seven cleanup operations that target different types of stale data in your WooCommerce database.

Cleanup Types

↑ Back to top
TypeWhat It FindsWhat It Does
Orphaned VariationsProduct variations whose parent product has been deletedPermanently deletes the orphaned variation posts
Orphaned Post MetaMetadata rows referencing posts that no longer existDeletes the orphaned postmeta entries
Empty CategoriesProduct categories with zero products assigned (excludes the default “Uncategorized” category)Deletes the empty category terms
Empty TagsProduct tags with zero products assignedDeletes the empty tag terms
Expired TransientsWooCommerce transient cache entries that have expiredDeletes the expired transient data from the options table
Expired CouponsPublished coupons with an expiration date in the pastPermanently deletes the expired coupon posts
Expired SessionsWooCommerce session records that have passed their expiry timeDeletes expired rows from the sessions table

How to Use

↑ Back to top

The Database tab displays a scan count for each cleanup type. Click Clean next to any type to remove those items. After cleanup, the count will drop to zero.

Each cleanup type is independent — you can clean one, several, or all types as needed.


Customer Cleanup

↑ Back to top

The Customers tab helps you find and remove inactive customer accounts.

Filter Types

↑ Back to top
FilterDescription
No OrdersCustomers who have never placed an order
Failed Orders OnlyCustomers whose every order has a failed or cancelled status. You can set a minimum number of failed orders as a threshold.

Additional Filters

↑ Back to top
  • Registered Before — Only include customers who registered before a specific date.
  • Exclude Roles — By default, Administrator and Shop Manager roles are always excluded from cleanup.

Scanning

↑ Back to top

Click Scan to preview matching customers. The table shows:

  • User ID
  • Username
  • Email address
  • Display name
  • Registration date
  • Order count
  • Last order date
  • User roles

Deleting Customers

↑ Back to top

Select customers or use the bulk action to delete all matching customers. Before deletion:

  • The customer’s posts and content are reassigned to an administrator account.
  • The currently logged-in user is never deleted.
  • Users with Administrator or Shop Manager roles are never deleted.

Customer deletion is permanent and cannot be undone.


Operation Logs

↑ Back to top

The Logs tab provides a complete history of every cleanup operation performed by the plugin.

Log Records

↑ Back to top

Each log entry includes:

  • Timestamp — When the operation was performed
  • Operation Type — Products, Duplicates, Media, Database, or Customers
  • Action Taken — The specific action (trash, delete, empty trash, etc.)
  • Items Affected — How many items were processed
  • Item Details — Detailed information about each affected item (stored as JSON)
  • Filters Used — Which filters were applied when the operation was triggered
  • User — The WordPress user who performed the operation

Filtering Logs

↑ Back to top

Use the following filters to find specific log entries:

  • Operation Type — Show only logs for a specific cleanup type
  • Date Range — Filter by start and end dates

Log Statistics

↑ Back to top

The Logs tab displays summary statistics:

  • Total number of operations performed
  • Total items affected across all operations
  • Breakdown by operation type (count and items per type)
  • Operations performed in the last 30 days

Clearing Logs

↑ Back to top

Click Clear All Logs to remove all log records. This action requires confirmation.

Log Retention

↑ Back to top

Logs are automatically cleaned up based on the Log Retention Days setting (default: 30 days). Old logs are removed after each scheduled cleanup run.


Scheduled Cleanups

↑ Back to top

Shop Cleaner can automate recurring cleanup operations using WordPress Cron (WP-Cron).

Enabling Scheduling

↑ Back to top
  1. Go to the Settings tab.
  2. Toggle Enable Scheduled Cleanups to on.
  3. Select a Frequency: Daily, Weekly, or Monthly.
  4. Choose which Cleanup Types to include:
  • Products
  • Media
  • Database
  • Customers
  1. Save your settings.

How Scheduled Cleanups Work

↑ Back to top

When a scheduled cleanup runs:

  • Products — Cleans products matching your saved product filters with a batch size of 100.
  • Media — Scans and deletes all orphaned product images.
  • Database — Runs all seven database cleanup types sequentially.
  • Customers — Removes customers with zero orders (using the “No Orders” filter).

Every scheduled run is fully logged in the Logs tab with all details.

Disabling Scheduling

↑ Back to top

Toggle the Enable Scheduled Cleanups setting to off. The scheduled WP-Cron event will be removed immediately.

Note: WP-Cron relies on site visits to trigger scheduled events. If your site has very low traffic, scheduled cleanups may not run exactly on time. Consider setting up a real cron job on your server for more precise scheduling.


Settings

↑ Back to top

The Settings tab lets you configure the plugin’s behavior.

SettingDefaultDescription
Delete Images with ProductsNoWhen enabled, featured images and gallery images are deleted along with their products
Batch Size20Number of items processed per batch during cleanup (range: 10–100)
Confirm Permanent DeleteYesShow a confirmation dialog before any permanent deletion
Enable Scheduled CleanupsNoActivate automated cleanup scheduling
Schedule FrequencyWeeklyHow often scheduled cleanups run (Daily, Weekly, or Monthly)
Schedule ActionsProductsWhich cleanup types to include in scheduled runs
Schedule Product FiltersNoneProduct filters to apply during scheduled product cleanup
Log Retention Days30How many days to keep operation log records

REST API

↑ Back to top

Shop Cleaner provides a full REST API for programmatic access. All endpoints are under the sc/v1 namespace and require the manage_woocommerce capability.

Authentication

↑ Back to top

All requests must be authenticated with a user who has the manage_woocommerce capability. Use standard WordPress REST API authentication methods (cookie with nonce, application passwords, or OAuth).

Endpoints

↑ Back to top

Settings

MethodEndpointDescription
GET/wp-json/sc/v1/settingsGet current plugin settings
POST/wp-json/sc/v1/settingsUpdate plugin settings

Products

MethodEndpointDescription
POST/wp-json/sc/v1/products/scanScan products matching filters
POST/wp-json/sc/v1/products/cleanClean one batch of matching products
POST/wp-json/sc/v1/products/empty-trashPermanently delete all trashed products

Scan/Clean Parameters:

ParameterTypeDescription
categorystringProduct category slug
product_typestringsimple, variable, grouped, or external
statusstringpublish, draft, pending, or private
stock_statusstringinstock, outofstock, or onbackorder
date_beforestringDate in YYYY-MM-DD format
min_pricenumberMinimum product price
max_pricenumberMaximum product price
tagstringProduct tag slug
actionstringtrash or delete (clean endpoint only)
delete_imagesbooleanDelete associated images (clean endpoint only)

Duplicates

MethodEndpointDescription
POST/wp-json/sc/v1/duplicates/scanFind duplicate products
POST/wp-json/sc/v1/duplicates/cleanRemove duplicate products

Scan Parameters:

ParameterTypeDescription
criteriastringsku, title, or both

Clean Parameters:

ParameterTypeDescription
groupsarrayDuplicate groups from scan results
keepstringoldest or newest
actionstringtrash or delete

Media

MethodEndpointDescription
POST/wp-json/sc/v1/media/scanScan for orphaned product images
POST/wp-json/sc/v1/media/cleanDelete orphaned images

Clean Parameters:

ParameterTypeDescription
idsarray(Optional) Specific image IDs to delete. If omitted, all orphaned images are deleted.

Database

MethodEndpointDescription
POST/wp-json/sc/v1/database/scanGet counts for all cleanup types
POST/wp-json/sc/v1/database/cleanClean a specific database type

Clean Parameters:

ParameterTypeDescription
typestringRequired. One of: orphaned_variations, orphaned_postmeta, empty_categories, empty_tags, expired_transients, expired_coupons, expired_sessions

Customers

MethodEndpointDescription
POST/wp-json/sc/v1/customers/scanScan customers matching filters
POST/wp-json/sc/v1/customers/cleanDelete customers

Parameters:

ParameterTypeDescription
filter_typestringno_orders or failed_orders
registered_beforestringDate in YYYY-MM-DD format
min_failed_ordersnumberMinimum failed orders threshold (for failed_orders filter)
customer_idsarraySpecific customer IDs to delete (clean endpoint only)

Logs

MethodEndpointDescription
GET/wp-json/sc/v1/logsGet log records with pagination
DELETE/wp-json/sc/v1/logsClear all logs

GET Parameters:

ParameterTypeDefaultDescription
pagenumber1Page number
per_pagenumber20Records per page (max: 100)
operation_typestringFilter by operation type
date_fromstringStart date (YYYY-MM-DD)
date_tostringEnd date (YYYY-MM-DD)

Statistics

MethodEndpointDescription
GET/wp-json/sc/v1/statsGet cleanup statistics

Response:

{
  "total_operations": 42,
  "total_items": 1250,
  "by_type": {
    "products": { "operations": 10, "items": 500 },
    "media": { "operations": 8, "items": 200 },
    "database": { "operations": 15, "items": 400 },
    "customers": { "operations": 5, "items": 100 },
    "duplicates": { "operations": 4, "items": 50 }
  },
  "recent_30_days": 12
}

Compatibility

↑ Back to top

WooCommerce HPOS

↑ Back to top

Shop Cleaner is fully compatible with WooCommerce High-Performance Order Storage (HPOS / Custom Order Tables). All customer and order queries automatically detect whether HPOS is enabled and use the appropriate query method.

WordPress & WooCommerce Versions

↑ Back to top
  • WordPress: 6.4 through 6.9.1 (tested)
  • WooCommerce: 8.0 through 10.5.1 (tested)
  • PHP: 7.4 and above

Themes

↑ Back to top

Shop Cleaner has no frontend output. It operates entirely within the WordPress admin, so it is compatible with any WordPress or WooCommerce theme.

Languages

↑ Back to top

The plugin is fully internationalized and translation-ready. It is available in 19 languages: English (US), Arabic, Danish, German, Greek, Spanish, Finnish, French, Hebrew, Indonesian, Italian, Japanese, Korean, Dutch, Portuguese (Brazil), Portuguese (Portugal), Russian, Swedish, and Turkish.


Frequently Asked Questions

↑ Back to top

Can I undo a cleanup operation?

↑ Back to top

Products moved to trash can be restored from the WordPress trash at any time. Permanently deleted items (products, media, customers, database entries) cannot be recovered. We recommend using the trash option first if you are unsure.

Will the plugin modify my store automatically on activation?

↑ Back to top

No. The plugin does not perform any cleanup operations on activation. All operations must be triggered explicitly from the settings page or through a scheduled cleanup that you configure.

Is it safe to use on a live store?

↑ Back to top

Yes. Shop Cleaner includes multiple safety features: trash before permanent delete, confirmation dialogs, batch processing, role protection for admins, and a complete audit log. We recommend testing on a staging site first and always maintaining backups.

Will this slow down my store?

↑ Back to top

No. Shop Cleaner only runs when you trigger a cleanup operation or when a scheduled cleanup executes. It does not add any overhead to your storefront or regular admin operations.

What happens to customer content when I delete customers?

↑ Back to top

Before a customer account is deleted, all of their posts and content are reassigned to an administrator account. This ensures no content is lost.

Can I schedule different cleanup types at different frequencies?

↑ Back to top

The current scheduling system uses a single frequency for all selected cleanup types. All selected types run together on the chosen schedule (daily, weekly, or monthly).

Does the plugin work with WooCommerce HPOS?

↑ Back to top

Yes. Shop Cleaner declares full compatibility with WooCommerce High-Performance Order Storage and automatically uses the correct query methods.

How do I access the REST API?

↑ Back to top

All endpoints are under the sc/v1 namespace. You need to authenticate as a user with the manage_woocommerce capability. See the REST API section for full endpoint documentation.


Uninstalling

↑ Back to top

When you deactivate the plugin:

  • Scheduled cleanup events are removed.
  • Your settings and operation logs are preserved (in case you reactivate).

When you delete the plugin through the WordPress admin:

  • The cleanup logs database table is dropped.
  • All plugin settings are removed from the options table.
  • Scheduled events are cleared.
  • No product, media, customer, or other WooCommerce data is affected.

Related Products

Offer add-ons like gift wrapping, special messages or other special options for your products.

Add shipment tracking information to your orders.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.