---
title: "Delete duplicate images in Hikashop after import"
date: 2020-05-19
author: "Jeroen Moolenschot"
---

# Delete duplicate images in Hikashop after import

When you have done an import, you may see the same product photos in Hikashop several times. You can delete these manually but with many products, this is no fun.

 
## Deleting duplicate images in Hikashop via the Database

 Of course, you always backup your website and database first (e.g. via akeebabackup).

 Then go to the PHPmyadmin environment and there execute the following SQL query to delete the duplicate images.

 `DELETE n1 FROM #__hikashop_file n1, #__hikashop_file n2 WHERE n1.file_id > n2.file_id AND n1.file_ref_id = n2.file_ref_id AND n1.file_path = n2.file_path AND n1.file_type='product'`

 
## Images are imported as files

 During import, it also happens that images are seen as downloadable files, these files were also previously imported as images, so are redundant and can be deleted.

 Of course, you always make a backup of your website and database first (e.g. via akeebabackup)

 Then go to the PHPmyadmin environment and there execute the following SQL query to delete the "files".

 `DELETE FROM `#__hikashop_file` WHERE `file_type` = 'file'`
