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

Optimising the Selection of MaxValue in Association

Is straight-up writing someone's opinions telling?

How could a medieval fortress manage large groups of migrants and travelers?

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

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

Kepler space telescope undetected planets

What is the meaning of [[:space:]] in bash?

Is passive Investigation essentially truesight against illusions?

Operation Unz̖̬̜̺̬a͇͖̯͔͉l̟̭g͕̝̼͇͓̪͍o̬̝͍̹̻

Did 007 exist before James Bond?

what relax command means?

Why is Google approaching my VPS machine?

Why don't commercial aircraft adopt a slightly more seaplane-like design to allow safer ditching in case of emergency?

Why did Steve Rogers choose this character in Endgame?

Vienna To Graz By Rail

Is this artwork (used in a video game) real?

Sending a photo of my bank account card to the future employer

A verb to describe specific positioning of three layers

Where are the rest of the Dwarves of Nidavellir?

Alphanumeric Line and Curve Counting

What is the point of a constraint expression on a non-templated function?

Should I be able to keep my company purchased standing desk when I leave my job?

What happens if a company buys back all of its shares?

ROT13 encoder/decoder



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

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

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?