Is there a way to remove sample data in Magento2 without uninstalling/re-installing Magento?

because I have changed settings in my back-end. and that I don't want to be removed.

But need to Remove all sample data also from back-end Like products categories and customers Etc.

  • You'll have to roll sleeves and remove all sample data related information from your Admin and Database manually. Plan it well, before beginning, so to avoid chaos and confusion. Feb 23, 2018 at 20:47

2 Answers 2


Run this in the console bin/magento sampledata:reset

Please make sure take a backup of your db.

Enter the following command for remove:

bin/magento sampledata:remove

Wait while sample data is removed.

For more See here.

  • it will only reset sample data , will not Remove from database It's only reset Command as you know also I have tried. Aug 24, 2016 at 4:53
  • I have updated the answer also please visit on given link for more detail
    – Arunendra
    Aug 24, 2016 at 5:10
  • yeah I have checked with command "bin/magento sampledata:remove" It's working fine. but as you know It will remove sample data files from directory and removed composer entries. But products and categories and attributes will not Remove from magento backend. Have you checked at your end ?? Aug 24, 2016 at 5:34

Not according to https://github.com/magento/magento2-sample-data which states that you need to drop the database and re-install.

bin/magento sampledata:reset will only add deleted sample data and bin/magento sampledata:remove will only remove the sample data modules, not the database entities.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.