# Custom validation settings on fields?

**URL:** <https://community.prismic.io/t/custom-validation-settings-on-fields/842>\
**Category:** Prismic for Content Creators\
**Tags:** product-feature-idea\
**Created:** [June 16, 2020, 3:09pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842 "2020-06-16T15:09:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcellothearcane](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/marcellothearcane/32/224_2.png) [@marcellothearcane](https://community.prismic.io/u/marcellothearcane)\
**Post date:** [June 16, 2020, 3:09pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/1 "2020-06-16T15:09:39Z")

</div>

It would be great if there was a custom validation feature available.

Something like the UID validation, but letting us choose what happens.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/f58c38c585860080b7dadfc64c59dfdc2685c516.png)

Some examples:

- Field required (i.e. image alts, label must be specified)
- Maximum field length (i.e. [160 chars max for meta description](https://moz.com/learn/seo/meta-description))

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [June 16, 2020, 3:53pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/2 "2020-06-16T15:53:09Z")

</div>

Hey Max,

This is something we’ve thought long and hard about. We’ve also discussed it at length in this blog post:  
[https://prismic.io/blog/required-fields](https://prismic.io/blog/required-fields)

We’re very open to discussing this and especially the other suggested solutions that we talked about in the article including:

- Completely removing null value (plus replacing them by default values)
- Pre-fill a new document with all default values.
- Empty document preview
- Warning at first publication: Avoid empty fields, mostly for SEO

Please read the article in depth so we can discuss easier the pain points and possible solutions when for implementing of a feature like this 😀

Thanks.

---

<div class="post-metadata">

**Author:** ![marcellothearcane](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/marcellothearcane/32/224_2.png) [@marcellothearcane](https://community.prismic.io/u/marcellothearcane)\
**Post date:** [June 17, 2020, 5:59am UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/3 "2020-06-17T05:59:02Z")

</div>

Thanks Phil, that is an interesting read. And it also sounds like quite a can of worms! 🐛

I agree that text defaults would be bad for content editors who want to use live preview, so I can understand that isn’t something that would be implemented.

However, default labels (which is my use-case specifically) _seems_ fairly innocuous - though maybe that would lead down a slippery slope of “I can have a default label, why not default text?”

What do you think about maximum and minimum length warnings? Something like the UI being orange around a field, or something. That could be used to indicate fields that probably should be default. (And provide guidance for SEO fields).

I suppose it’s a case of me thinking I have a perfectly reasonable use-case - I’m not going to smack ‘required’ on every single field - but once it is possible, people will, and that will be nasty.

---

<div class="post-metadata">

**Author:** ![jaiew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/jaiew/32/784_2.png) [@jaiew](https://community.prismic.io/u/jaiew)\
**Post date:** [September 4, 2020, 1:05am UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/7 "2020-09-04T01:05:23Z")

</div>

Hi Phil,

One of the items that Marcello mentioned which would be quite useful is just having a field length. It wouldn’t have to be a validation and wouldn’t have to prevent publishing but it would be nice if we could set guidelines so content editors can see they have gone over the defined limit by highlighting the field as they edit.

Is this something that could be considered?

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [September 4, 2020, 3:19pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/8 "2020-09-04T15:19:42Z")

</div>

Hi Jaie,

Welcome to the community!

I really like that idea, I’ve added it to the request tracker and I’m going to bring it up in person with the features team.

Obviously though this isn’t something that we are working on at the minute. If/when this changes we’ll update you here.

Thanks.

---

<div class="post-metadata">

**Author:** ![shyamal890](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/shyamal890/32/866_2.png) [@shyamal890](https://community.prismic.io/u/shyamal890)\
**Post date:** [September 19, 2020, 6:27am UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/9 "2020-09-19T06:27:30Z")

</div>

**Usecase 1**  
A lot of time the frontend is designed to only accommodate only a certain number of characters. This is where having a min and max limits helps a lot.

**Usecase 2**  
Helps a lot with Metatags. Typically description metatag can only have a limited number of characters being shown in Google serp. Show need to limit the number of characters the creator enters.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [September 23, 2020, 9:57am UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/10 "2020-09-23T09:57:49Z")

</div>

Hey Shyamal,

I think these are really strong use cases, especially the second one concerning the descriptions metatag. I've added both of them to the Productboard for the team to see.

If the product team needs more information they'll reach out here.

Thanks.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [September 24, 2020, 12:57pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/11 "2020-09-24T12:57:37Z")

</div>

This is being tracked as an open feature request.

If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the ❤ button to show your support for the feature and check out our [Feature Request Guidelines](https://community.prismic.io/t/feature-requests-what-do-you-already-love-what-could-be-better/844).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [August 21, 2021, 3:34pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/12 "2021-08-21T15:34:41Z")

</div>



---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/dan/32/2382_2.png) [@dan](https://community.prismic.io/u/dan)\
**Post date:** [August 21, 2021, 3:54pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/13 "2021-08-21T15:54:25Z")

</div>

I have another use case for _some kind_ of required fields

I've recently had to create a blog with the following URL structure

/blog/[category]/[post]

If the category is missing, the URL is broken. For the sake of argument, let's say we can't shorten the URL to /blog/post if a category is missing (there are numerous reasons why this solution doesn't work)

In order to ensure a category is defined, you either have to assign posts on a category custom type or assign categories within individual posts. Regardless of your approach, a category is required to make the URL work **and for a static build complete**

With prismic's current setup, this is impossible. It's very easy to miss adding categories to a post or posts on a category and once it's been missed there's no indication **which** post/category combination has been missed. You have to go through one by one to find the right one.

In my opinion, prismic should not be opinionated about how URLs should be structured and in this scenario ([which is one prismic suggests in one of its examples](https://prismic.io/docs/technologies/the-route-resolver-nextjs#3.-with-a-parent)) it is both opinionated, and that opinion makes creating a solution much more complicated.

* * *

Based on the discussion above and my understanding of the approach prismic wants to take I think having a warning within the post if a field is missing required content (like the UID field already does) but also raise that warning up so it's visible on the dashboard (maybe even having a tab dedicated to fixing issues raised in this manner so they can be resolved more easily?)

Even better, having another warning akin to "broken links" on publish to ensure that all posts have all required fields completed would be amazing, while simply returning an uncategorised post to draft if it's trying to be published, like broken links do.

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [August 23, 2021, 8:01pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/14 "2021-08-23T20:01:00Z")

</div>

Hey @dan

Thank you for sharing the details of your use case with us. This helps us to have a clear vision of the product's needs from the user's side.

The way links are connected to create URLs later involves having a clear communication process between those who build the Content Modeling of the Custom Types and the Writers and Publishers.

If it is not possible to create an alternative that allows the URLs to be error-proof at the code level, then it is true that a warning would be handy in the writing room UI.

I'm going to add your comment as part of the feature request on the productboard.

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [September 1, 2021, 9:24pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/16 "2021-09-01T21:24:41Z")

</div>

This is being tracked as an open feature request.

If you have another use-case for this feature, you can ['Flag' this topic to reopen](https://community.prismic.io/t/re-open-a-thread/2175). Please use the ❤ button to show your support for the feature and check out our [Feature Request Guidelines](https://community.prismic.io/t/feature-requests-what-do-you-already-love-what-could-be-better/844).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 12:35pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/17 "2021-12-09T12:35:34Z")

</div>



---

<div class="post-metadata">

**Author:** ![shyamal890](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/shyamal890/32/866_2.png) [@shyamal890](https://community.prismic.io/u/shyamal890)\
**Post date:** [January 7, 2022, 3:20am UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/18 "2022-01-07T03:20:32Z")

</div>

I would like to understand if there was any commitment on this feature?

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [January 7, 2022, 2:21pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/20 "2022-01-07T14:21:21Z")

</div>

Hi @shyamal890,

We're still evaluating required fields and field validation, but it's not on our road map at the moment. Feel free to add a ❤ to this thread to show your support.

Sam

---

<div class="post-metadata">

**Author:** ![james0r](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/james0r/32/4065_2.png) [@james0r](https://community.prismic.io/u/james0r)\
**Post date:** [March 19, 2022, 9:44pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/22 "2022-03-19T21:44:51Z")

</div>

It's shocking this is even being met with resistance. Nearly all meta field apps have this ability for obvious reasons. Limiting number of fields is something we have to do on the frontend on nearly every site.

---

<div class="post-metadata">

**Author:** ![joshwcorbett](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@joshwcorbett](https://community.prismic.io/u/joshwcorbett)\
**Post date:** [June 30, 2022, 8:16pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/24 "2022-06-30T20:16:28Z")

</div>

It's starting to feel like Prismic is trying to find reasons NOT to include fundamental features, instead of coming up with new reasons they should be added.  
Nearly every cms supports these, this and deeply nested group/slices have been in limbo for 2 years now and I can't believe they aren't a priority.

---

<div class="post-metadata">

**Author:** ![ianboyte](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/ianboyte/32/5450_2.png) [@ianboyte](https://community.prismic.io/u/ianboyte)\
**Post date:** [October 14, 2022, 7:48pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/25 "2022-10-14T19:48:08Z")

</div>

Absolutely. This needs to be addressed.

---

<div class="post-metadata">

**Author:** ![dmakos](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/dmakos/32/5426_2.png) [@dmakos](https://community.prismic.io/u/dmakos)\
**Post date:** [January 4, 2023, 12:27pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/28 "2023-01-04T12:27:29Z")

</div>

I'm really looking forward to implementation of required fields - I worked with other CMS's and nearly all of them have the ability to specify fields that are required.

Some fields on my project MUST be filled in no matter what, I cannot have an article without the title for example. Currently I have to validate on the template and/or provide a placeholder which is a bit meh.

---

<div class="post-metadata">

**Author:** ![vincent.nyamu](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/vincent.nyamu/32/8676_2.png) [@vincent.nyamu](https://community.prismic.io/u/vincent.nyamu)\
**Post date:** [August 2, 2023, 2:23pm UTC](https://community.prismic.io/t/custom-validation-settings-on-fields/842/31 "2023-08-02T14:23:35Z")

</div>

Is there any update on this?  
Not seeing this mentioned anywhere by the Prismic team and/or on [prismic.io/progress](http://prismic.io/progress)?

Last post about this from Prismic was from 2018?

[Next page](https://community.prismic.io/t/custom-validation-settings-on-fields/842.md?page=2)
