Remove the “Edit Form” link
Article Last Updated: March 4, 2021

You may notice forms have a link below them with the text “Edit Form”, as seen in the above screenshot.
This text will only be visible under the following conditions:
- The user viewing the page is logged into the WordPress site
- The user viewing the page has the
manage_options
capability
Note: you can change the
manage_options
capability to any capability you’d like using the following filter:yikes-mailchimp-user-role-access
. If you’re using this filter, make sure you’re using a valid role/capability that can be passed into thecurrent_user_can()
function.
If you’d still like to remove this link (for example, maybe you want to view your form exactly as a user would), you can use the filter yikes-mailchimp-front-end-action-links.
Filter: yikes-mailchimp-front-end-action-links
Parameters:
$edit_form_link
– the HTML comprising the edit form link$form_id
– the ID of the current form$form_title
– the title of the current form
Example:
function yikes_mailchimp_remove_action_links( $edit_link_html, $form_id, $form_name ) { return ''; } add_filter( 'yikes-mailchimp-front-end-form-action-links', 'yikes_mailchimp_remove_action_links', 99999, 3 );
The above code snippet will remove the action link in all cases. However, we provide the $form_id
so it’s quite simple to run conditional logic based on the form.
Note: if you have the Customizer extension installed, this code will remove the “Customize Form” link.