How to prevent an approved entry from being edited
To stop users from editing an entry once it’s approved, use the gravityview/edit_entry/user_can_edit_entry filter. It removes the Edit Entry link and blocks the edit page. Hiding the link with Field Conditional Logic needs no code, but an edit address the user saved earlier still works.
Block editing of approved entries #
/**
* Stop users from editing an entry once it's approved.
*
* Administrators, editors, and other moderators can still edit it.
* Runs at priority 30, after Magic Links changes the same answer at priority 20.
*
* @param bool $user_can_edit Whether the user can edit it.
* @param array|\GV\Entry|\WP_Error $entry An array, an object or a WP_Error.
*
* @return bool Whether the user can edit the entry.
*/
add_filter(
'gravityview/edit_entry/user_can_edit_entry',
function ( $user_can_edit, $entry ) {
if ( GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
return $user_can_edit;
}
if ( $entry instanceof \GV\Entry ) {
$entry = $entry->as_entry();
}
if ( ! is_array( $entry ) ) {
return $user_can_edit;
}
$status = GravityView_Entry_Approval::get_entry_status( $entry, 'value' );
if ( GravityView_Entry_Approval_Status::is_approved( $status ) ) {
return false;
}
return $user_can_edit;
},
30,
2
);Note: Not sure where to add this code? See Adding custom PHP code snippets to your website.
On an approved entry, the Edit Entry link disappears for that user. Opening a saved edit address shows “You do not have permission to edit this entry.” Entries that aren’t approved can still be edited, and administrators and editors can still edit every entry.
On a View with Enable Magic Links turned on, approved entries lose the Edit Entry link for the entry’s creator and for visitors. A saved edit address of an approved entry opens the Request Edit Access form, and a magic link for it shows “You do not have permission to edit this entry.”
Hide only the Edit Entry link #
With Field Conditional Logic, you can hide the link on approved entries without code. It is part of Advanced Filtering, which is built into GravityView Pro. To turn it on or off, go to Plugins and click Features in the GravityView Pro row.
- In the View editor, click the gear icon on the Link to Edit Entry field.
- Under Visibility, click Add Condition. Choose Approval Status as the field and Unapproved as the value. The operator is always
isfor Approval Status. - Click + Condition and choose Approval Status and Disapproved the same way. The two conditions are joined by OR, which is already selected.
- Close the settings window and click Update.

With OR, either condition can match. Approved entries have no Edit Entry link, including for administrators.

Warning: This only hides the link. A user who saved the edit address can still open it and save changes to an approved entry. Use the filter above to block editing.
To show the link inside a Custom Content field instead, wrap the [gv_entry_link] shortcode in [gvlogic] with the {approval_status} merge tag. A Link to Edit Entry field on the same layout keeps showing its link, so remove it.
[gvlogic if="{approval_status}" isnot="approved"]
[gv_entry_link action="edit"]
[/gvlogic]Close editing at a deadline instead #
To close editing at a deadline, such as 48 hours after an entry is submitted, use the Edit Window section of the View's Edit Entry settings tab. Its custom closing rules check the deadline and the values of form fields. The approval status isn't one of them, so Edit Window can't replace the code above.
Close editing at a deadline shows what changes for your users, and Setting an editing deadline with Edit Window covers each kind of deadline. The Magic Links tab has a separate setting also named Edit Window, which limits magic links only.
Send edited entries back for review instead #
To let users keep editing and review each change, see Unapproving entries automatically after they're edited.