How to remove products url for specific Category URL-REWRITEOptimize catalog product url rewriteURL rewrite for category in layered navigation to external URLMagento 2 URL rewrite IndexHow Magento 2 url rewrite works?How to remove parent category from subcategory URL?How can i rewrite my category url for redirect new siteMagento 2 Rewrite Category to CMS Page?Remove random number from rewrite urlIs Possible Main Category URL Rewrite Management?Magento 2 query url rewrite

How to find location on Cambridge-Mildenhall railway that still has tracks/rails?

Where are the rest of the Dwarves of Nidavellir?

Alphanumeric Line and Curve Counting

Do dragons smell of lilacs?

Did Voldemort kill his father before finding out about Horcruxes?

Is this Android phone Android 9.0 or Android 6.0?

What details should I consider before agreeing for part of my salary to be 'retained' by employer?

Is it rude to refer to janitors as 'floor people'?

Why do space operations use "nominal" to mean "working correctly"?

Increasing muscle power without increasing volume

What were the problems on the Apollo 11 lunar module?

How many bits in the resultant hash will change, if the x bits are changed in its the original input?

How can I help our ranger feel special about her beast companion?

Why is the total probability theorem expressed in this way?

Is the purpose of sheet music to be played along to? Or a guide for learning and reference during playing?

Cauchy reals and Dedekind reals satisfy "the same mathematical theorems"

How to color a tag in a math equation?

Optimising the Selection of MaxValue in Association

Migrating Configuration - 3750G to 3750X

Credit card details stolen every 1-2 years. What am I doing wrong?

Is it okay for a chapter's POV to shift as it progresses?

Generating a PIN from cryptographic bytes

Which GPUs to get for Mathematical Optimization (if any...)?

Why is Google approaching my VPS machine?



How to remove products url for specific Category URL-REWRITE


Optimize catalog product url rewriteURL rewrite for category in layered navigation to external URLMagento 2 URL rewrite IndexHow Magento 2 url rewrite works?How to remove parent category from subcategory URL?How can i rewrite my category url for redirect new siteMagento 2 Rewrite Category to CMS Page?Remove random number from rewrite urlIs Possible Main Category URL Rewrite Management?Magento 2 query url rewrite






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I want to remove url of prodcuts for a specific category. How can i remove specific category URL-REWRITE? using Query pro-grammatically










share|improve this question
























  • Did you resolve your query?

    – Shoaib Munir
    Jul 9 at 12:48






  • 1





    yes i done that let me past my answer

    – Asad Ullah
    Jul 10 at 5:47

















1















I want to remove url of prodcuts for a specific category. How can i remove specific category URL-REWRITE? using Query pro-grammatically










share|improve this question
























  • Did you resolve your query?

    – Shoaib Munir
    Jul 9 at 12:48






  • 1





    yes i done that let me past my answer

    – Asad Ullah
    Jul 10 at 5:47













1












1








1








I want to remove url of prodcuts for a specific category. How can i remove specific category URL-REWRITE? using Query pro-grammatically










share|improve this question
















I want to remove url of prodcuts for a specific category. How can i remove specific category URL-REWRITE? using Query pro-grammatically







magento2 products url-rewrite






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 9 at 6:20







Asad Ullah

















asked Jul 9 at 5:58









Asad UllahAsad Ullah

42613 bronze badges




42613 bronze badges












  • Did you resolve your query?

    – Shoaib Munir
    Jul 9 at 12:48






  • 1





    yes i done that let me past my answer

    – Asad Ullah
    Jul 10 at 5:47

















  • Did you resolve your query?

    – Shoaib Munir
    Jul 9 at 12:48






  • 1





    yes i done that let me past my answer

    – Asad Ullah
    Jul 10 at 5:47
















Did you resolve your query?

– Shoaib Munir
Jul 9 at 12:48





Did you resolve your query?

– Shoaib Munir
Jul 9 at 12:48




1




1





yes i done that let me past my answer

– Asad Ullah
Jul 10 at 5:47





yes i done that let me past my answer

– Asad Ullah
Jul 10 at 5:47










2 Answers
2






active

oldest

votes


















1














$objectManager = MagentoFrameworkAppObjectManager::getInstance();


$resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
$connection = $resource->getConnection();
$tableName = $resource->getTableName('url_rewrite');
try
$sql = "DELETE FROM `url_rewrite` WHERE `entity_type` LIKE 'category' AND `target_path` LIKE '%id/234'";
$connection->query($sql);

catch(Exception $e)
echo 'Message: ' .$e->getMessage();



here in querry target_path (%id/234) defines your category






share|improve this answer


















  • 1





    Good to know that you have resolved it. +1 :)

    – Shoaib Munir
    Jul 10 at 6:02






  • 1





    thanks for your help man

    – Asad Ullah
    Jul 10 at 7:28


















0














You can use this command to delete product URL for specific category



DELETE FROM url_rewrite WHERE target_path LIKE 'catalog/product/view/id/[PROD_ID]/category/[CAT_ID]'


where PROD_ID is your product id, and CAT_ID is the ID of category from which you need to delete URL.






share|improve this answer

























    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%2f281288%2fhow-to-remove-products-url-for-specific-category-url-rewrite%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    $objectManager = MagentoFrameworkAppObjectManager::getInstance();


    $resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
    $connection = $resource->getConnection();
    $tableName = $resource->getTableName('url_rewrite');
    try
    $sql = "DELETE FROM `url_rewrite` WHERE `entity_type` LIKE 'category' AND `target_path` LIKE '%id/234'";
    $connection->query($sql);

    catch(Exception $e)
    echo 'Message: ' .$e->getMessage();



    here in querry target_path (%id/234) defines your category






    share|improve this answer


















    • 1





      Good to know that you have resolved it. +1 :)

      – Shoaib Munir
      Jul 10 at 6:02






    • 1





      thanks for your help man

      – Asad Ullah
      Jul 10 at 7:28















    1














    $objectManager = MagentoFrameworkAppObjectManager::getInstance();


    $resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
    $connection = $resource->getConnection();
    $tableName = $resource->getTableName('url_rewrite');
    try
    $sql = "DELETE FROM `url_rewrite` WHERE `entity_type` LIKE 'category' AND `target_path` LIKE '%id/234'";
    $connection->query($sql);

    catch(Exception $e)
    echo 'Message: ' .$e->getMessage();



    here in querry target_path (%id/234) defines your category






    share|improve this answer


















    • 1





      Good to know that you have resolved it. +1 :)

      – Shoaib Munir
      Jul 10 at 6:02






    • 1





      thanks for your help man

      – Asad Ullah
      Jul 10 at 7:28













    1












    1








    1







    $objectManager = MagentoFrameworkAppObjectManager::getInstance();


    $resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
    $connection = $resource->getConnection();
    $tableName = $resource->getTableName('url_rewrite');
    try
    $sql = "DELETE FROM `url_rewrite` WHERE `entity_type` LIKE 'category' AND `target_path` LIKE '%id/234'";
    $connection->query($sql);

    catch(Exception $e)
    echo 'Message: ' .$e->getMessage();



    here in querry target_path (%id/234) defines your category






    share|improve this answer













    $objectManager = MagentoFrameworkAppObjectManager::getInstance();


    $resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
    $connection = $resource->getConnection();
    $tableName = $resource->getTableName('url_rewrite');
    try
    $sql = "DELETE FROM `url_rewrite` WHERE `entity_type` LIKE 'category' AND `target_path` LIKE '%id/234'";
    $connection->query($sql);

    catch(Exception $e)
    echo 'Message: ' .$e->getMessage();



    here in querry target_path (%id/234) defines your category







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jul 10 at 5:51









    Asad UllahAsad Ullah

    42613 bronze badges




    42613 bronze badges







    • 1





      Good to know that you have resolved it. +1 :)

      – Shoaib Munir
      Jul 10 at 6:02






    • 1





      thanks for your help man

      – Asad Ullah
      Jul 10 at 7:28












    • 1





      Good to know that you have resolved it. +1 :)

      – Shoaib Munir
      Jul 10 at 6:02






    • 1





      thanks for your help man

      – Asad Ullah
      Jul 10 at 7:28







    1




    1





    Good to know that you have resolved it. +1 :)

    – Shoaib Munir
    Jul 10 at 6:02





    Good to know that you have resolved it. +1 :)

    – Shoaib Munir
    Jul 10 at 6:02




    1




    1





    thanks for your help man

    – Asad Ullah
    Jul 10 at 7:28





    thanks for your help man

    – Asad Ullah
    Jul 10 at 7:28













    0














    You can use this command to delete product URL for specific category



    DELETE FROM url_rewrite WHERE target_path LIKE 'catalog/product/view/id/[PROD_ID]/category/[CAT_ID]'


    where PROD_ID is your product id, and CAT_ID is the ID of category from which you need to delete URL.






    share|improve this answer



























      0














      You can use this command to delete product URL for specific category



      DELETE FROM url_rewrite WHERE target_path LIKE 'catalog/product/view/id/[PROD_ID]/category/[CAT_ID]'


      where PROD_ID is your product id, and CAT_ID is the ID of category from which you need to delete URL.






      share|improve this answer

























        0












        0








        0







        You can use this command to delete product URL for specific category



        DELETE FROM url_rewrite WHERE target_path LIKE 'catalog/product/view/id/[PROD_ID]/category/[CAT_ID]'


        where PROD_ID is your product id, and CAT_ID is the ID of category from which you need to delete URL.






        share|improve this answer













        You can use this command to delete product URL for specific category



        DELETE FROM url_rewrite WHERE target_path LIKE 'catalog/product/view/id/[PROD_ID]/category/[CAT_ID]'


        where PROD_ID is your product id, and CAT_ID is the ID of category from which you need to delete URL.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jul 9 at 6:05









        Shoaib MunirShoaib Munir

        5,2886 gold badges23 silver badges69 bronze badges




        5,2886 gold badges23 silver badges69 bronze badges



























            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%2f281288%2fhow-to-remove-products-url-for-specific-category-url-rewrite%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

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form