• Skip to primary navigation
  • Skip to main content
Daniel McClure

Daniel McClure

Entrepreneurship, Marketing, Technology, Travel & Lifestyle

  • About
  • Credentials
  • The Blog of Daniel McClure
  • Social
  • Code
  • Contact
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter

Delete Gravity Form Entries After Submission

Code snippet posted to GitHub Gist by Daniel McClure.

You are here: Home » Code Snippets » #PHP » Delete Gravity Form Entries After Submission

Last Updated: December 13, 2018 Leave a Comment

The following is a code snippet originally posted by Daniel McClure on GitHub as a Gist.

functions.php

“`
Original Gist


<?php
// Delete Gravity Form Entries for form ID 1 after submission.
// Switch action to `gform_after_submission` to target all forms.
add_action( 'gform_after_submission_1', 'remove_form_entry' );
function remove_form_entry( $entry ) {
GFAPI::delete_entry( $entry['id'] );
}

view raw

functions.php

hosted with ❤ by GitHub

Filed Under: GitHub Gist Tagged With: #PHP

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *

You can encrypt your comment so that only Daniel McClure can read it.

Daniel McClure

Work With Me

Get in touch if you’re interested in working together on your next project.

Contact Me

Creative Commons Licence

Copyright © 2025 Daniel McClure

All opinions shared through this site are that of their respective author and are not necessarily representative of the views of past/present clients, affiliate partners or businesses.
Some links include affiliate tracking for which I may earn a commission. See the Full Disclaimer Page for more information.