Removendo Campos de Upload de Arquivo das Notificações Quando Restrições de Acesso a Arquivos Estão Habilitadas

Would you like to completely remove file upload fields from your form notifications when file access restrictions are enabled? This can be useful when you don’t want restricted files to be included in email notifications at all, helping to keep sensitive or private uploads secure.

In this tutorial, we’ll show you how to add a PHP snippet that removes restricted file upload fields from notifications, either for all forms or for specific form IDs.


Adicionando o Trecho de Código

Para começar, você precisará adicionar o trecho abaixo ao seu site. Se você não tem certeza de como ou onde adicionar trechos,  revise esta documentação útil.

The example below removes file upload fields with File Access Restrictions enabled from notifications for a specific form ID.

You’ll need to update the form ID (1 in the example above in line 10) to match the form you want to target.

Como Funciona

The snippet uses the wpforms_emails_notifications_field_ignored filter to skip adding a field to email notifications when:

  • The form matches your specified form ID.
  • The field is a file upload field.
  • The field has File Access Restrictions enabled.

When all these conditions are met, the field will be removed from the outgoing email.

That’s it! Now you know how to remove restricted file upload fields from WPForms notifications for a specific form.

Next, would you like to exclude certain fields from your form email notifications when using the {all_fields} smart tag? See our tutorial on Removing Specific Fields from the {all_fields} Smart Tag.