• Resolved Hassan Hossinie



    how to i can disable delete product permanently
    set $force_delete = false

    Please set this filter hook

    I could not find everything I looked for Where the product is removed Disable permanent deletion

    Please let me know how to resolve

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @onlinerir,

    Can you please use the mentioned CSS on your theme additional CSS section :

    .row-actions span:nth-child(2) {
        display: none;

    It should help you hide it πŸ™‚

    Thread Starter Hassan Hossinie



    I am a professional developer And this solution of yours does not work for me

    I also changed the code in this file:
    this code:
    dokan()->product->delete( $product_id, true );
    dokan()->product->delete( $product_id, false );

    But still the product is completely erased.

    Hello @onlinerir ,

    The change you have made on the code will disable the force delete warning because the “delete” function parameter is like that. You can see it here –

    Path: \dokan-lite\includes\Product\Manager.php
    Function: delete()

    Now, if you want to remove the vendor option to delete product permanently, you can use this code –

    add_filter('dokan_product_row_actions', function($row_action) {
    	return $row_action;
    add_filter('dokan_bulk_product_statuses', function($bulk_actions) {
    	return $bulk_actions;

    You can also remove this capability from the seller user role – dokan_delete_product

    I hope this helps.

    Thank you πŸ™‚

    Thread Starter Hassan Hossinie


    i want when product deleted , it moved to trash

    but now deleted permamently

    Hello @onlinerir ,

    Unfortunately, I do not have the exact example to make this function modified to set the product to trashed. You may want to use this WordPress function – wp_trash_post( int $post_id ) replacing the delete functionality.

    Thank you πŸ™‚

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to disable delete product permanently’ is closed to new replies.