How do i delete products which are not in a category?How to tell which products are not catgorized via phpmyadminWrong number of products in categoryFrom which category are products from search resultProducts not showingProducts are not showing in category Magento 2some products are not billing and checking outWhy is magento 1.9 presenting same products whatever the category when all cache are activated?Magento: Delete products and 301 redirect to relevant it's parent categoryCore URL re-write table - delete URL entries for deleted productsMagento2.3.0 Categories - I wish the products which are in child category will be visible in each parent category by default
Emphasize numbers in tables
Was Wolfgang Unziker the last Amateur GM?
German idiomatic equivalents of 能骗就骗 (if you can cheat, then cheat)
Could citing a database like libgen get one into trouble?
What is the meaning of ゴト in the context of 鮎
Sentences with no verb, but an ablative
Are there advantages in writing by hand over typing out a story?
Are the plates of a battery really charged?
How might boat designs change in order to allow them to be pulled by dragons?
Why am I getting an electric shock from the water in my hot tub?
How to extract coefficients of a generating function like this one, using a computer?
Find the closest three-digit hex colour
What could a Medieval society do with excess animal blood?
Why did the Middle Kingdom stop building pyramid tombs?
Does the Grothendieck group of finitely generated modules form a commutative ring where the multiplication structure is induced from tensor product?
Variable declaration inside main loop
How far can gerrymandering go?
Disk usage confusion: 10G missing on Linux home partition on SSD
Finding an optimal set without forbidden subsets
Which high-degree derivatives play an essential role?
Is it OK to say "The situation is pregnant with a crisis"?
Square wave to sawtooth wave using two BJT
Why are symbols not written in words?
Can I hire several veteran soldiers to accompany me?
How do i delete products which are not in a category?
How to tell which products are not catgorized via phpmyadminWrong number of products in categoryFrom which category are products from search resultProducts not showingProducts are not showing in category Magento 2some products are not billing and checking outWhy is magento 1.9 presenting same products whatever the category when all cache are activated?Magento: Delete products and 301 redirect to relevant it's parent categoryCore URL re-write table - delete URL entries for deleted productsMagento2.3.0 Categories - I wish the products which are in child category will be visible in each parent category by default
our site has over 90,000 products which need to be deleted and are not in categories, but the products in the categories we want to keep, how do i solve this?
magento-1.9 product category-products delete
New contributor
add a comment |
our site has over 90,000 products which need to be deleted and are not in categories, but the products in the categories we want to keep, how do i solve this?
magento-1.9 product category-products delete
New contributor
Can you please specify Magento version ?
– Abdul Pathan
Jun 24 at 10:31
explain briefly what you exactly doing ??
– Rk Rathod
Jun 24 at 10:31
Magento 1 ver. 1.9.3.7
– joe willmott
Jun 24 at 10:32
I am trying to delete all products which are not in active categories
– joe willmott
Jun 24 at 10:32
add a comment |
our site has over 90,000 products which need to be deleted and are not in categories, but the products in the categories we want to keep, how do i solve this?
magento-1.9 product category-products delete
New contributor
our site has over 90,000 products which need to be deleted and are not in categories, but the products in the categories we want to keep, how do i solve this?
magento-1.9 product category-products delete
magento-1.9 product category-products delete
New contributor
New contributor
edited Jun 24 at 10:33
Shoaib Munir
4,6846 gold badges22 silver badges67 bronze badges
4,6846 gold badges22 silver badges67 bronze badges
New contributor
asked Jun 24 at 10:26
joe willmottjoe willmott
312 bronze badges
312 bronze badges
New contributor
New contributor
Can you please specify Magento version ?
– Abdul Pathan
Jun 24 at 10:31
explain briefly what you exactly doing ??
– Rk Rathod
Jun 24 at 10:31
Magento 1 ver. 1.9.3.7
– joe willmott
Jun 24 at 10:32
I am trying to delete all products which are not in active categories
– joe willmott
Jun 24 at 10:32
add a comment |
Can you please specify Magento version ?
– Abdul Pathan
Jun 24 at 10:31
explain briefly what you exactly doing ??
– Rk Rathod
Jun 24 at 10:31
Magento 1 ver. 1.9.3.7
– joe willmott
Jun 24 at 10:32
I am trying to delete all products which are not in active categories
– joe willmott
Jun 24 at 10:32
Can you please specify Magento version ?
– Abdul Pathan
Jun 24 at 10:31
Can you please specify Magento version ?
– Abdul Pathan
Jun 24 at 10:31
explain briefly what you exactly doing ??
– Rk Rathod
Jun 24 at 10:31
explain briefly what you exactly doing ??
– Rk Rathod
Jun 24 at 10:31
Magento 1 ver. 1.9.3.7
– joe willmott
Jun 24 at 10:32
Magento 1 ver. 1.9.3.7
– joe willmott
Jun 24 at 10:32
I am trying to delete all products which are not in active categories
– joe willmott
Jun 24 at 10:32
I am trying to delete all products which are not in active categories
– joe willmott
Jun 24 at 10:32
add a comment |
1 Answer
1
active
oldest
votes
Create a custom script on root directory
delete_products.php
code would be this:
<?php
include_once __DIR__ . '/app/Mage.php';
Mage::app('admin');
//Getting all prdoucts collection
$collection = Mage::getResourceModel('productslider/product_collection')
->addAttributeToSelect('*');
foreach($collection as $prod)
$prodId = $prod->getId();
$_product = Mage::getModel('catalog/product')->load($prodId);
$categoryIds = $_product->getCategoryIds();
if(count($categoryIds) == 0)
//Delete prdouct
//$_product->delete();
echo $prodId;
I have used echo and commented delete function. You first need to dry run this script, and if it is giving you the products that need to be deleted, then uncomment delete code.
The main problem i also have is that i do not know who hosts the site and where any of the root files i need are. My compnay have set me the task to sort it out with no info, is there a way to see where the Cpanel is?
– joe willmott
Jun 24 at 10:45
I have no idea which hosting you are using. You need code access to do this task, otherwise this is nearly impossible
– Shoaib Munir
Jun 24 at 10:52
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
);
);
joe willmott is a new contributor. Be nice, and check out our Code of Conduct.
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%2f279382%2fhow-do-i-delete-products-which-are-not-in-a-category%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
Create a custom script on root directory
delete_products.php
code would be this:
<?php
include_once __DIR__ . '/app/Mage.php';
Mage::app('admin');
//Getting all prdoucts collection
$collection = Mage::getResourceModel('productslider/product_collection')
->addAttributeToSelect('*');
foreach($collection as $prod)
$prodId = $prod->getId();
$_product = Mage::getModel('catalog/product')->load($prodId);
$categoryIds = $_product->getCategoryIds();
if(count($categoryIds) == 0)
//Delete prdouct
//$_product->delete();
echo $prodId;
I have used echo and commented delete function. You first need to dry run this script, and if it is giving you the products that need to be deleted, then uncomment delete code.
The main problem i also have is that i do not know who hosts the site and where any of the root files i need are. My compnay have set me the task to sort it out with no info, is there a way to see where the Cpanel is?
– joe willmott
Jun 24 at 10:45
I have no idea which hosting you are using. You need code access to do this task, otherwise this is nearly impossible
– Shoaib Munir
Jun 24 at 10:52
add a comment |
Create a custom script on root directory
delete_products.php
code would be this:
<?php
include_once __DIR__ . '/app/Mage.php';
Mage::app('admin');
//Getting all prdoucts collection
$collection = Mage::getResourceModel('productslider/product_collection')
->addAttributeToSelect('*');
foreach($collection as $prod)
$prodId = $prod->getId();
$_product = Mage::getModel('catalog/product')->load($prodId);
$categoryIds = $_product->getCategoryIds();
if(count($categoryIds) == 0)
//Delete prdouct
//$_product->delete();
echo $prodId;
I have used echo and commented delete function. You first need to dry run this script, and if it is giving you the products that need to be deleted, then uncomment delete code.
The main problem i also have is that i do not know who hosts the site and where any of the root files i need are. My compnay have set me the task to sort it out with no info, is there a way to see where the Cpanel is?
– joe willmott
Jun 24 at 10:45
I have no idea which hosting you are using. You need code access to do this task, otherwise this is nearly impossible
– Shoaib Munir
Jun 24 at 10:52
add a comment |
Create a custom script on root directory
delete_products.php
code would be this:
<?php
include_once __DIR__ . '/app/Mage.php';
Mage::app('admin');
//Getting all prdoucts collection
$collection = Mage::getResourceModel('productslider/product_collection')
->addAttributeToSelect('*');
foreach($collection as $prod)
$prodId = $prod->getId();
$_product = Mage::getModel('catalog/product')->load($prodId);
$categoryIds = $_product->getCategoryIds();
if(count($categoryIds) == 0)
//Delete prdouct
//$_product->delete();
echo $prodId;
I have used echo and commented delete function. You first need to dry run this script, and if it is giving you the products that need to be deleted, then uncomment delete code.
Create a custom script on root directory
delete_products.php
code would be this:
<?php
include_once __DIR__ . '/app/Mage.php';
Mage::app('admin');
//Getting all prdoucts collection
$collection = Mage::getResourceModel('productslider/product_collection')
->addAttributeToSelect('*');
foreach($collection as $prod)
$prodId = $prod->getId();
$_product = Mage::getModel('catalog/product')->load($prodId);
$categoryIds = $_product->getCategoryIds();
if(count($categoryIds) == 0)
//Delete prdouct
//$_product->delete();
echo $prodId;
I have used echo and commented delete function. You first need to dry run this script, and if it is giving you the products that need to be deleted, then uncomment delete code.
answered Jun 24 at 10:42
Shoaib MunirShoaib Munir
4,6846 gold badges22 silver badges67 bronze badges
4,6846 gold badges22 silver badges67 bronze badges
The main problem i also have is that i do not know who hosts the site and where any of the root files i need are. My compnay have set me the task to sort it out with no info, is there a way to see where the Cpanel is?
– joe willmott
Jun 24 at 10:45
I have no idea which hosting you are using. You need code access to do this task, otherwise this is nearly impossible
– Shoaib Munir
Jun 24 at 10:52
add a comment |
The main problem i also have is that i do not know who hosts the site and where any of the root files i need are. My compnay have set me the task to sort it out with no info, is there a way to see where the Cpanel is?
– joe willmott
Jun 24 at 10:45
I have no idea which hosting you are using. You need code access to do this task, otherwise this is nearly impossible
– Shoaib Munir
Jun 24 at 10:52
The main problem i also have is that i do not know who hosts the site and where any of the root files i need are. My compnay have set me the task to sort it out with no info, is there a way to see where the Cpanel is?
– joe willmott
Jun 24 at 10:45
The main problem i also have is that i do not know who hosts the site and where any of the root files i need are. My compnay have set me the task to sort it out with no info, is there a way to see where the Cpanel is?
– joe willmott
Jun 24 at 10:45
I have no idea which hosting you are using. You need code access to do this task, otherwise this is nearly impossible
– Shoaib Munir
Jun 24 at 10:52
I have no idea which hosting you are using. You need code access to do this task, otherwise this is nearly impossible
– Shoaib Munir
Jun 24 at 10:52
add a comment |
joe willmott is a new contributor. Be nice, and check out our Code of Conduct.
joe willmott is a new contributor. Be nice, and check out our Code of Conduct.
joe willmott is a new contributor. Be nice, and check out our Code of Conduct.
joe willmott is a new contributor. Be nice, and check out our Code of Conduct.
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%2f279382%2fhow-do-i-delete-products-which-are-not-in-a-category%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
Can you please specify Magento version ?
– Abdul Pathan
Jun 24 at 10:31
explain briefly what you exactly doing ??
– Rk Rathod
Jun 24 at 10:31
Magento 1 ver. 1.9.3.7
– joe willmott
Jun 24 at 10:32
I am trying to delete all products which are not in active categories
– joe willmott
Jun 24 at 10:32