• Resolved yonish3

    (@yonish3)


    I have tried using this query that I found for deleting All products, have changed it a bit. But it deleted all attributes of existing products.

    
    DELETE relations.*, taxes.*, terms.*
    FROM wp_term_relationships AS relations
    INNER JOIN wp_term_taxonomy AS taxes
    ON relations.term_taxonomy_id=taxes.term_taxonomy_id
    INNER JOIN wp_terms AS terms
    ON taxes.term_id=terms.term_id
    WHERE object_id IN (ID1, ID2 ... 500 more IDs);
    
    DELETE FROM wp_postmeta WHERE post_id IN ( (ID1, ID2 ... 500 more IDs);
    DELETE FROM wp_posts WHERE <code>ID</code> IN  (ID1, ID2 ... 500 more IDs);
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter yonish3

    (@yonish3)

    Have solved it using the REST API batch call.
    But will still be glad if someone has this in SQL query, as the API takes some time and many resources.

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    laceyrod

    (@laceyrod)

    Automattic Happiness Engineer

    Hi there,

    This thread has been inactive for a bit, so I’m going to mark it as Resolved now for the overall health of the forums. Please feel free to check out the resources listed above for assistance.

    Alternatively, you can check out the following paid services for customizations/developer help: https://woocommerce.com/customizations/

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to remove bulk products by ID from woocomarce using SQL?’ is closed to new replies.