Title: Disable delete
Last modified: September 23, 2023

---

# Disable delete

 *  Resolved [mikeyvanrijsbergen](https://wordpress.org/support/users/mikeyvanrijsbergen/)
 * (@mikeyvanrijsbergen)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/disable-delete-2/)
 * I would like to disable the delete button for a certen userrole. so that customers
   don’t get unnessesery emails.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [wpdevelop](https://wordpress.org/support/users/wpdevelop/)
 * (@wpdevelop)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/disable-delete-2/#post-17074128)
 * Hello. 
   Do you need to disable the delete button at the Booking Listing page 
   in admin panel ? Or what exactly button do you mean? Can you send the screenshot?
   Thank you.
 * Please note, if you simply need to deactivate the sending emails to customer 
   after deletion of the booking or approving, etc.. then you can disable option“
   Email sending” at the top right side under filter toolbar at the Booking Listing
   page.
 * Kind regards.
 *  Thread Starter [mikeyvanrijsbergen](https://wordpress.org/support/users/mikeyvanrijsbergen/)
 * (@mikeyvanrijsbergen)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/disable-delete-2/#post-17076079)
 * Hello,
 * It is indeed the delete button in de admin panel, for when the booking is not
   excepted and is already in the trashcan.
 * ![](https://i0.wp.com/mvr-ict.nl/wp-content/uploads/2023/09/bookingcalander.png?
   ssl=1)
 * Sorry fot the Dutch, but i want to disable the button with the red arrow. but
   only for 1 rol.
 * Not only because of the mail but also becaise we need to save the information
   for 2 year for finance department.
 *  Plugin Author [wpdevelop](https://wordpress.org/support/users/wpdevelop/)
 * (@wpdevelop)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/disable-delete-2/#post-17076149)
 * Hello.
 *  Is it okay if this button is only visible to users with the ‘Administrator’ 
   role and not shown to users with other roles on your website?
 * Kind regards.
 *  Thread Starter [mikeyvanrijsbergen](https://wordpress.org/support/users/mikeyvanrijsbergen/)
 * (@mikeyvanrijsbergen)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/disable-delete-2/#post-17076291)
 * Hello,
 * yes if that is possible.
    -  This reply was modified 2 years, 8 months ago by [mikeyvanrijsbergen](https://wordpress.org/support/users/mikeyvanrijsbergen/).
 *  Plugin Author [wpdevelop](https://wordpress.org/support/users/wpdevelop/)
 * (@wpdevelop)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/disable-delete-2/#post-17076857)
 * Hello.
   By default it’s does not possible from the settings of the plugin to configure
   it, yet. But you can make this fix.
 * Please open this file ../{Booking Calendar Folder}/includes/page-bookings/bookings__actions.
   php
 * ( you can check how to edit files in WordPress menu in this article [https://wpbookingcalendar.com/faq/how-edit-file-in-wp-menu/](https://wpbookingcalendar.com/faq/how-edit-file-in-wp-menu/))
 * Then find this code:
 * `case 'delete_booking_completely':
   break;
 * and replace it to this code:
 * `case 'delete_booking_completely':
   $user = get_userdata( $user_id );$user_roles
   = ( empty( $user ) ? array() : $user->roles );if ( ! in_array( 'administrator',(
   array) $user_roles ) ) {/* WordPress standard roles: 'administrator'|'editor'
   |'author'|'contributor'|'subscriber' */return false;}break;
 *  **Disclaimer**. Check more about, what support we are providing here [https://wpbookingcalendar.com/faq/what-support-do-you-provide/](https://wpbookingcalendar.com/faq/what-support-do-you-provide/)
   
   Thank you for understanding.
 * Kind Regards.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Disable delete’ is closed to new replies.

 * ![](https://ps.w.org/booking/assets/icon-256x256.gif?rev=3335907)
 * [Booking Calendar](https://wordpress.org/plugins/booking/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/booking/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/booking/)
 * [Active Topics](https://wordpress.org/support/plugin/booking/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/booking/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/booking/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [wpdevelop](https://wordpress.org/support/users/wpdevelop/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/disable-delete-2/#post-17076857)
 * Status: resolved