Skip Navigation

[Gelöst] Custom field – File – File type restriction

This support ticket is created vor 2 Jahre, 11 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 Antworten, has 2 Stimmen.

Last updated by Christian Cox vor 2 Jahre, 11 Monate.

Assigned support staff: Christian Cox.

Capture d’écran 2020-02-19 à 09.45.26.png

Hi, is there a way to restrict a custom field file to only allow .pdf?



Hello, there is no built-in way to limit the file types accepted by a file field, but if the posts are created with Forms you can use the Forms validation API to enforce specific file type(s). We have some information about this in several places:

...and in various other tickets in the forum. This approach only works when posts are created with Forms and the Media Library is used to handle media uploads in that Form.

Let me know if you have questions about implementing this API and I can take a closer look.


So there is no way presently to limit the file type directly in the wordpress backend? We don't use Forms


Yes, that is correct. The only public field content validation APIs provided by Toolset are for validating Forms submissions, not uploads in wp-admin.