Title: Cannot validate taxonomy field
Last modified: July 29, 2023

---

# Cannot validate taxonomy field

 *  Resolved [awjensen](https://wordpress.org/support/users/awjensen/)
 * (@awjensen)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/cannot-validate-taxonomy-field/)
 * I want to create an error if the user selects an invalid taxonomy value. (The
   taxonomy is used for more than one custom post type.) If the user selects a taxonomy
   value that begins with “featured” I want to display an error and prevent the 
   user from saving the post. I have the return value set to “Term object” and I
   have tried to put the word ‘Featured” in quotes and without. I can’t figure out
   how to make this work.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-validate-taxonomy-field/#post-17154023)
 * Hello!
 * You can use the [acf/validate_value](https://www.advancedcustomfields.com/resources/acf-validate_value/)
   hook in order to validate the value of any field, which include the native [ACF Taxonomy field](https://www.advancedcustomfields.com/resources/taxonomy/)
   or the [ACFE Taxonomy Terms field](https://www.acf-extended.com/features/fields/taxonomy-terms).
 * Note that the `$value` argument in this hook will be a `Term ID` so you’ll have
   to use `get_term()` ([see documentation](https://developer.wordpress.org/reference/functions/get_term/))
   to retrieve its actual name and return an error if needed.
 * Hope it answers your question.
 * Regards.

Viewing 1 replies (of 1 total)

The topic ‘Cannot validate taxonomy field’ is closed to new replies.

 * ![](https://ps.w.org/acf-extended/assets/icon-256x256.png?rev=2071550)
 * [Advanced Custom Fields: Extended](https://wordpress.org/plugins/acf-extended/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-extended/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-extended/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-extended/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-extended/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-extended/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-validate-taxonomy-field/#post-17154023)
 * Status: resolved