How to identify deleted product

How to identify deleted product

August 18, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to identify deleted product

Identifying Deleted Items in Magento

If you’re dealing with deleted items in your Magento database and looking for a way to identify them, this guide will provide you with the necessary information.

Understanding Magento’s Database Schema

Magento uses a relational database management system (RDBMS) like MySQL or PostgreSQL. The core data is stored in tables that represent different entities within the application, such as products, categories, and customers.

When an item is deleted from the backend, it isn’t actually removed from the database. Instead, Magento uses a soft delete mechanism to mark the record as inactive.

The is_deleted Column

The key field that identifies deleted items in most Magento tables is called is_deleted. This column is typically of type INT(1) and defaults to 0 for active records. When an item is deleted, Magento sets this value to 1.

Here’s a simple example of how the catalog_product_entity table might look:

CREATE TABLE catalog_product_entity (
    entity_id INT PRIMARY KEY,
    attribute_set_id INT NOT NULL,
    type_id VARCHAR(32) NOT NULL,
    sku VARCHAR(64),
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    is_deleted TINYINT(1) UNSIGNED ZEROFILL DEFAULT 0
);

Querying for Deleted Items

To find all deleted items in a table, you can use the following SQL query as a template:

SELECT * FROM catalog_product_entity WHERE is_deleted = 1;

Replace catalog_product_entity with the name of the table you’re interested in.

For example, to find all deleted categories, you would use:

SELECT * FROM catalog_category_entity WHERE is_deleted = 1;

Recovering Deleted Items

If you need to recover a deleted item, you can simply set is_deleted back to 0. For instance, if you have a deleted product with an ID of 1234:

UPDATE catalog_product_entity SET is_deleted = 0 WHERE entity_id = 1234;

Conclusion

Identifying deleted items in Magento is straightforward once you understand the is_deleted column. This field is present in most core tables and allows for easy querying of soft-deleted records.

Remember, while this approach works for many core tables, some extensions might handle deletions differently. Always check the table schema in your specific installation to ensure consistency.

For a detailed guide on Magento database management, I recommend checking out our Magento Database Optimization Guide at Laravel Company.

Catalog Database Themes Admin

Our network