I want to remove sample data or reinstall magento 2.2.1 without sample data

i tried below command.

php bin/magento sampledata:remove

command is not working and throwing below error

The 'https://repo.magento.com/packages.json' URL required authentication.
You must be using the interactive console to authenticate

1 Answer 1


Removing Magento sample data, unfortunately, is not as easy as to install it.

Running the command

php bin/magento sampledata:remove

Doesn't really remove all products from your Admin Inventory, from your frontend view, neither from the database. This you'll have to do manually.

What this command does is remove sample data from your composer.json

I think the error Composer throws is associated with the fact that you have already removed the sample-data packages from your composer.json and now running the command again, there is nothing to remove.

Here is what Magento Documentation states about removing sample data:

There is currently no way to uninstall sample data. We recommend you use sample data only to learn about how Magento works. Avoid doing any development in a system in which you installed sample data.


Bummer. Time for some manual labor.

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.