How do I remove the “Edit Form” link

Article Last Updated: October 12, 2017

You may notice that your 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:

  1. The user viewing the page is logged into the WordPress site
  2. 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 the current_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:

  1. $edit_form_link – the HTML comprising the edit form link
  2. $form_id – the ID of the current form
  3. $form_title – the title of the current form

Example:

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.

As always, reach out to us if you need help.

Kevin.