Title: error in taxonomy post_format
Last modified: December 3, 2021

---

# error in taxonomy post_format

 *  Resolved [Ambyomoron](https://wordpress.org/support/users/josiah-s-carberry/)
 * (@josiah-s-carberry)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-in-taxonomy-post_format/)
 * In note that WordPress creates by default a taxonomy called ‘post_format’ a single
   term in that taxonomy: ‘post-format-gallery’.
 * One of my posts has a relationship with that term, a relationship that should
   not exist. I have no idea how that relationship had been created and I cannot
   find how to remove it programmatically.
 * I know for sure that I did not create this relationship by tinkering with the
   database, so I assume that it must have happened in the context of a theme or
   a plugin. However, none of my plugins make any reference at all to this taxonomy
   and the theme provides no functionality at all for linking a post to a post format(
   using the post_format taxonomy).
 * So, does anyone have an idea
    1) how this erroneous relationship might have come
   about; and 2) how to remove the relationship programmatically; and if that is
   not possible 3) what to look out for when simply deleting the relevant row from
   the wp_term_relationships table.
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-in-taxonomy-post_format/#post-15133986)
 * Any theme that supports post formats that may have been in use in the past could
   have assigned the term.
 * You can use [wp_set_post_terms()](https://developer.wordpress.org/reference/functions/wp_set_post_terms/)
   to actually unset terms for a post by passing an empty string for `$tags` (and
   passing `'post_format'` for `$taxonomy` of course). This should be effective 
   whether your current theme supports post formats or not.
 *  Thread Starter [Ambyomoron](https://wordpress.org/support/users/josiah-s-carberry/)
 * (@josiah-s-carberry)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-in-taxonomy-post_format/#post-15134190)
 * Thanks very much. That seems to have done the trick. I note that the taxonomy
   term itself is still there. How would I get rid of that (or could I simply delete
   the row from the table)?
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-in-taxonomy-post_format/#post-15136766)
 * In wp_terms? If there are no references to it in wp_term_taxonomy then yes, the
   row could be removed. Be sure there are no related wp_termmeta entries, or remove
   those too.
 * But to be more “proper”, use [wp_delete_term()](https://developer.wordpress.org/reference/functions/wp_delete_term/).
 *  Thread Starter [Ambyomoron](https://wordpress.org/support/users/josiah-s-carberry/)
 * (@josiah-s-carberry)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-in-taxonomy-post_format/#post-15137029)
 * Thanks again. I’m getting the hang of how to do this stuff.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘error in taxonomy post_format’ is closed to new replies.

## Tags

 * [post_format](https://wordpress.org/support/topic-tag/post_format/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [Ambyomoron](https://wordpress.org/support/users/josiah-s-carberry/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/error-in-taxonomy-post_format/#post-15137029)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
