Delete all products and reset their Ids with least queries as possibleBundle products search/reset filter redirects to dashboardHow to Delete All Products Within a CategoryDelete old data before migrationImported simple products are not associated with their parent configurable productsDisplaying Simple Product Stock On Configurable ProductAdded Products are showing out of stockWant to import all the categories and their products to new magento install from old oneTruncate Custom Attribute Label/Options using SQL QueryCan i get all customers, along with their address information, using the REST api?Delete All products
How does an ARM MCU run faster than the external crystal?
Where did the “Vikings wear helmets with horn” stereotype come from and why?
shutdown at specific date
Were pen cap holes designed to prevent death by suffocation if swallowed?
Can a non-EU citizen travel within schengen zone freely without passport?
Pattern matching repeated arguments of Times
How to capture more stars?
Why does the 6502 have the BIT instruction?
How does apt-get work, in detail?
Why did this prime-sequence puzzle not work?
What are these (utility?) boxes at the side of the house?
Where do I put diamond mines on my map?
Do you play the upbeat when beginning to play a series of notes, and then after?
What does "Marchentalender" on the front of a postcard mean?
What is the difference between nullifying your vote and not going to vote at all?
Is it possible to change original filename of an exe?
How many chess players are over 2500 Elo?
What are the problems in teaching guitar via Skype?
How can I find where certain bash function is defined?
Can a wire having a 610-670 THz (frequency of blue light) AC frequency supply, generate blue light?
Is a post-climate apocolypse city in which many or most insects have disappeared realistic?
Can non-English-speaking characters use wordplay specific to English?
Different PCB color ( is it different material? )
Draw a checker pattern with a black X in the center
Delete all products and reset their Ids with least queries as possible
Bundle products search/reset filter redirects to dashboardHow to Delete All Products Within a CategoryDelete old data before migrationImported simple products are not associated with their parent configurable productsDisplaying Simple Product Stock On Configurable ProductAdded Products are showing out of stockWant to import all the categories and their products to new magento install from old oneTruncate Custom Attribute Label/Options using SQL QueryCan i get all customers, along with their address information, using the REST api?Delete All products
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Can somebody suggest an intermediate way to delete all products in magento and reset their table's increment id to 1 without using multiple "truncate" queries found when Googling ?
Magento version ce-1.9.x
magento-1.9 products delete
add a comment |
Can somebody suggest an intermediate way to delete all products in magento and reset their table's increment id to 1 without using multiple "truncate" queries found when Googling ?
Magento version ce-1.9.x
magento-1.9 products delete
add a comment |
Can somebody suggest an intermediate way to delete all products in magento and reset their table's increment id to 1 without using multiple "truncate" queries found when Googling ?
Magento version ce-1.9.x
magento-1.9 products delete
Can somebody suggest an intermediate way to delete all products in magento and reset their table's increment id to 1 without using multiple "truncate" queries found when Googling ?
Magento version ce-1.9.x
magento-1.9 products delete
magento-1.9 products delete
asked Oct 5 '15 at 6:41
Vicky DevVicky Dev
1,30771740
1,30771740
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
to delete all the products, Create a file DeleteProduct.php inside your magento root folder and write the below code in that file and then execute it with below URL http://www.yourdomain.com/DeleteProduct.php
try the below code :
<?php
require_once('app/Mage.php');
umask(0);
Mage::app('admin');
$productCollection = Mage::getModel('catalog/product')
->getCollection();
foreach($productCollection as $_product)
{
$productID = $_product->getId();
try
Mage::getModel("catalog/product")->load($productID)->delete(); // this will delete product
catch (Exception $exception)
var_dump($exception);
die('Exception Thrown');
@Manashvi birlaas I said, I also want to reset the product's table auto-increment id to 1 along with deleting products.
– Vicky Dev
Oct 5 '15 at 6:53
u'll have to manually set the auto-increment like thisALTER TABLE table_name AUTO_INCREMENT = 1;
– Manashvi Birla
Oct 5 '15 at 7:04
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f85224%2fdelete-all-products-and-reset-their-ids-with-least-queries-as-possible%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
to delete all the products, Create a file DeleteProduct.php inside your magento root folder and write the below code in that file and then execute it with below URL http://www.yourdomain.com/DeleteProduct.php
try the below code :
<?php
require_once('app/Mage.php');
umask(0);
Mage::app('admin');
$productCollection = Mage::getModel('catalog/product')
->getCollection();
foreach($productCollection as $_product)
{
$productID = $_product->getId();
try
Mage::getModel("catalog/product")->load($productID)->delete(); // this will delete product
catch (Exception $exception)
var_dump($exception);
die('Exception Thrown');
@Manashvi birlaas I said, I also want to reset the product's table auto-increment id to 1 along with deleting products.
– Vicky Dev
Oct 5 '15 at 6:53
u'll have to manually set the auto-increment like thisALTER TABLE table_name AUTO_INCREMENT = 1;
– Manashvi Birla
Oct 5 '15 at 7:04
add a comment |
to delete all the products, Create a file DeleteProduct.php inside your magento root folder and write the below code in that file and then execute it with below URL http://www.yourdomain.com/DeleteProduct.php
try the below code :
<?php
require_once('app/Mage.php');
umask(0);
Mage::app('admin');
$productCollection = Mage::getModel('catalog/product')
->getCollection();
foreach($productCollection as $_product)
{
$productID = $_product->getId();
try
Mage::getModel("catalog/product")->load($productID)->delete(); // this will delete product
catch (Exception $exception)
var_dump($exception);
die('Exception Thrown');
@Manashvi birlaas I said, I also want to reset the product's table auto-increment id to 1 along with deleting products.
– Vicky Dev
Oct 5 '15 at 6:53
u'll have to manually set the auto-increment like thisALTER TABLE table_name AUTO_INCREMENT = 1;
– Manashvi Birla
Oct 5 '15 at 7:04
add a comment |
to delete all the products, Create a file DeleteProduct.php inside your magento root folder and write the below code in that file and then execute it with below URL http://www.yourdomain.com/DeleteProduct.php
try the below code :
<?php
require_once('app/Mage.php');
umask(0);
Mage::app('admin');
$productCollection = Mage::getModel('catalog/product')
->getCollection();
foreach($productCollection as $_product)
{
$productID = $_product->getId();
try
Mage::getModel("catalog/product")->load($productID)->delete(); // this will delete product
catch (Exception $exception)
var_dump($exception);
die('Exception Thrown');
to delete all the products, Create a file DeleteProduct.php inside your magento root folder and write the below code in that file and then execute it with below URL http://www.yourdomain.com/DeleteProduct.php
try the below code :
<?php
require_once('app/Mage.php');
umask(0);
Mage::app('admin');
$productCollection = Mage::getModel('catalog/product')
->getCollection();
foreach($productCollection as $_product)
{
$productID = $_product->getId();
try
Mage::getModel("catalog/product")->load($productID)->delete(); // this will delete product
catch (Exception $exception)
var_dump($exception);
die('Exception Thrown');
answered Oct 5 '15 at 6:47
Manashvi BirlaManashvi Birla
6,61761941
6,61761941
@Manashvi birlaas I said, I also want to reset the product's table auto-increment id to 1 along with deleting products.
– Vicky Dev
Oct 5 '15 at 6:53
u'll have to manually set the auto-increment like thisALTER TABLE table_name AUTO_INCREMENT = 1;
– Manashvi Birla
Oct 5 '15 at 7:04
add a comment |
@Manashvi birlaas I said, I also want to reset the product's table auto-increment id to 1 along with deleting products.
– Vicky Dev
Oct 5 '15 at 6:53
u'll have to manually set the auto-increment like thisALTER TABLE table_name AUTO_INCREMENT = 1;
– Manashvi Birla
Oct 5 '15 at 7:04
@Manashvi birla as I said, I also want to reset the product's table auto-increment id to 1 along with deleting products.– Vicky Dev
Oct 5 '15 at 6:53
@Manashvi birla as I said, I also want to reset the product's table auto-increment id to 1 along with deleting products.– Vicky Dev
Oct 5 '15 at 6:53
u'll have to manually set the auto-increment like this
ALTER TABLE table_name AUTO_INCREMENT = 1;– Manashvi Birla
Oct 5 '15 at 7:04
u'll have to manually set the auto-increment like this
ALTER TABLE table_name AUTO_INCREMENT = 1;– Manashvi Birla
Oct 5 '15 at 7:04
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f85224%2fdelete-all-products-and-reset-their-ids-with-least-queries-as-possible%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown