Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

frm_after_entry_meta_change

Heads up! This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or third-party development.

Use the frm_after_entry_meta_change action to run code right after Formidable adds, updates, or deletes a single field value of an entry. When it runs, the change is already saved in the database.

Use it to keep your own data in sync with entry values, such as a cached total or a copy of a value in another system. When a write fails, Formidable runs frm_entry_meta_write_failed instead.

Requirements

  • Formidable Forms 7.0 or later. The hook is part of Formidable Forms Lite.

Formidable Forms makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.

When it fires

The action runs once per field value, after each of these writes:

  • Add: a field value is saved for the first time, such as when a new entry is submitted.
  • Update: an existing field value is saved again, such as when an entry is edited. It runs even when the value didn't change. Editing an entry fires it for every field that has a value.
  • Delete: a single field value is removed, including a value that was cleared when an entry was edited.

Formidable Forms Pro uses this hook to refresh its own index of entry values.

Usage

add_action( 'frm_after_entry_meta_change', 'my_function_name', 10, 2 );

Parameters

  • $entry_id (int): The ID of the entry the value belongs to.
  • $field_id (int): The ID of the field whose value changed.

Examples

Learn where to put the code when adding a custom PHP function to your site.

Clear a cached value when a field changes

This example deletes a saved transient whenever one of the listed fields is saved. That includes editing an entry without changing those fields. Your own code can then rebuild it from the new values. Replace 25 and 26 with the IDs of your fields, and my_frm_order_total with the name of your transient.

add_action( 'frm_after_entry_meta_change', 'my_frm_clear_cached_total', 10, 2 );
function my_frm_clear_cached_total( $entry_id, $field_id ) {
	$watched_fields = array( 25, 26 ); // Change 25 and 26 to the IDs of your fields.
	if ( in_array( (int) $field_id, $watched_fields, true ) ) {
		delete_transient( 'my_frm_order_total' );
	}
}

To compare the old and new value of a field, pair this hook with frm_before_entry_meta_change. That hook's page has a full example.

Limitations

  • The hook runs only for values saved through Formidable's entry value functions. Deleting a whole entry, a field, or all entries of a form removes the values without firing it.
  • For values removed when an entry is edited, the hook runs after the delete query even if the query fails.
Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2026 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Complete your purchase
    Don't forget your purchase!
    Complete Purchase
    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms