Title: Fatal Error Programmatically Deleting Taxonomy Terms
Last modified: November 12, 2021

---

# Fatal Error Programmatically Deleting Taxonomy Terms

 *  Resolved [danpw](https://wordpress.org/support/users/danpw/)
 * (@danpw)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-programmatically-deleting-taxonomy-terms/)
 * We have code that programmatically deletes all of the terms of a taxonomy using
   wp_delete_term(). Starting in Yoast 17.3, when this code runs, it looks like 
   Yoast is causing a fatal error:
 * PHP Fatal error: Uncaught Exception: Primary key ID missing from row or is null
   in /app/public/wp-content/plugins/wordpress-seo/lib/orm.php:2059
 * Any help would be greatly appreciated.

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

 *  [Suwash Kunwar](https://wordpress.org/support/users/suascat_wp/)
 * (@suascat_wp)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-programmatically-deleting-taxonomy-terms/#post-15064498)
 * [@danpw](https://wordpress.org/support/users/danpw/)
 * While we are pretty unsure with your current setup though we understand you’re
   getting Fatal errors thrown from one of the core files in the Yoast SEO directory.
 * In case if it helps, can you please try resetting our indexables in the database
   tables by following the steps below?
    1. Install & activate the Yoast Test Helper
   plugin 2. Go to Tools > Yoast Test 3. Hit the “Reset indexables & migrations”
   button. 4. Go to SEO > Tools, and under SEO data, click the “SEO Data Optimization”
   button to allow Yoast to rescan your pages.
 * _For your site’s health and safety, we recommend creating regular backups of 
   your site and database. This is especially important before installing, updating,
   or removing plugins. Learn more about the benefits of regular backups._
 * Make sure you’re running latest WordPress version v5.8.1 and Yoast SEO 7.5 and
   all non Yoast plugins and themes up to date.
 *  Thread Starter [danpw](https://wordpress.org/support/users/danpw/)
 * (@danpw)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-programmatically-deleting-taxonomy-terms/#post-15078857)
 * Hey [@suascat_wp](https://wordpress.org/support/users/suascat_wp/), thanks for
   taking a look. These steps didn’t help the issue.
 * That being said, I had also created a GitHub issue for this, so I think it’s 
   safe to close this out.
 * [https://github.com/Yoast/wordpress-seo/issues/17643](https://github.com/Yoast/wordpress-seo/issues/17643)
 *  Plugin Support [Michael Tiña](https://wordpress.org/support/users/mikes41720/)
 * (@mikes41720)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-programmatically-deleting-taxonomy-terms/#post-15083378)
 * Hi [@danpw](https://wordpress.org/support/users/danpw/)
 * Thanks for opening a GitHub issue. We’ll be closing this forum thread to keep
   the forum overview, and one of our developers will take a look and respond to
   the GitHub issue accordingly.

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

The topic ‘Fatal Error Programmatically Deleting Taxonomy Terms’ is closed to new
replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Michael Tiña](https://wordpress.org/support/users/mikes41720/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-programmatically-deleting-taxonomy-terms/#post-15083378)
 * Status: resolved