Delete database row after contact entry is deleted in WordPress
The below code will delete a row from a custom WordPress database table when a contact entry is deleted. The below example will try to match the row based on the email address of the user.
The below code matches based on the email
column, but you can change this to whatever your usecase might be. For instance if you use unique codes to track entries you can do that as well.
You can also match it based on the $entry_id
as long as you made sure you stored this when inserting the row into your custom database which is enabled by default under the column entry_id
.
PreviousInsert form data into a custom database tableNextLimited date availability (slots) for your WordPress booking form
Last updated