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;








1















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










share|improve this question




























    1















    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










    share|improve this question
























      1












      1








      1








      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










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 5 '15 at 6:41









      Vicky DevVicky Dev

      1,30771740




      1,30771740




















          1 Answer
          1






          active

          oldest

          votes


















          0














          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');






          share|improve this answer























          • @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











          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          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');






          share|improve this answer























          • @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















          0














          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');






          share|improve this answer























          • @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













          0












          0








          0







          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');






          share|improve this answer













          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');







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Oct 5 '15 at 6:47









          Manashvi BirlaManashvi Birla

          6,61761941




          6,61761941












          • @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

















          • @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
















          @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

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

          Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

          Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림