Title: WordPress database error when update to PHP 8
Last modified: March 9, 2023

---

# WordPress database error when update to PHP 8

 *  Resolved [Platoscave](https://wordpress.org/support/users/platoscave/)
 * (@platoscave)
 * [3 years ago](https://wordpress.org/support/topic/wordpress-database-error-when-update-to-php-8/)
 * Hi Yoast support,
   I have some code updating post metadata as follows:update_post_meta(
   $wpPageId, $key = ‘_yoast_wpseo_title’, $value = $pageMetadata[“seoTitle”]);wp_update_post(
   $wpPageId);The above code is working with PHP 7.4. But when updating to PHP 8,
   this line: wp_update_post($wpPageId); produces a critical error.To fix this I
   changed the $wpPageId to an array like so:$wpPageIdArray = array(‘ID’ => $wpPageId);
   wp_update_post($wpPageIdArray);The problem is that now with this updated code
   I’m recieving WordPress Data base errors as follows:**WordPress database error:**[
   Unknown column ‘indexable_id’ in ‘where clause’]`DELETE FROM ``wp_yoast_seo_links`
   WHERE `post_id` = '8' AND `indexable_id` IS NULL /* From [example.com/] in [path/
   wp-content/plugins/wordpress-seo/lib/orm.php:287] and **WordPress database error:**[
   Unknown column ‘target_indexable_id’ in ‘field list’]`SELECT COUNT( id ) AS ``
   incoming`, `target_indexable_id` FROM `wp_yoast_seo_links` WHERE `target_indexable_id`
   IN ('1230', '6632', '73', '6695', '100', '5126', '92', '100', '6691', '3', '5126','
   92', '229', '73', '73', '73', '73', '73', '73', '73', '73', '73', '100') GROUP
   BY `target_indexable_id` /* From [example.com/] in [path/wp-content/plugins/wordpress-
   seo/lib/orm.php:287]I would really appreciate any help you can give me about 
   what I’m doing wrong?
    -  This topic was modified 3 years ago by [Platoscave](https://wordpress.org/support/users/platoscave/).

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

 *  Plugin Support [Maybellyne](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [3 years ago](https://wordpress.org/support/topic/wordpress-database-error-when-update-to-php-8/#post-16543619)
 * Hello [@platoscave](https://wordpress.org/support/users/platoscave/)
 * Thanks for reaching out about your WordPress database errors. We have seen unexpected
   issues where the previously optimized data is invalid or incomplete. We’ll start
   with resetting the optimization to ensure we remove invalid data. However we 
   know that resetting the data may sound intimidating, but our [How to reset the Yoast indexables](https://yoast.com/help/how-to-reset-yoast-indexables/)
   guide will walk you through the process step by step. We’ve also summarized the
   steps below:
    1. Install & activate the [Yoast Test Helper plugin](https://wordpress.org/plugins/yoast-test-helper/)
    2. Go to Tools > Yoast Test
    3. Locate the Yoast SEO section and click on the ‘_Reset indexables tables & migrations_‘,‘
       _Reset Prominent words calculation_‘, and ‘_Reset Internal link counter_‘ buttons.
       After each click, the page will reload to confirm that the specific reset was
       successful.
    4. Go to SEO > Tools, and under SEO data, click the “Start SEO data optimization”
       button to allow Yoast to rescan your content.
 * Please let us know if the reported issue remains after resetting the optimized
   data.
 *  Thread Starter [Platoscave](https://wordpress.org/support/users/platoscave/)
 * (@platoscave)
 * [3 years ago](https://wordpress.org/support/topic/wordpress-database-error-when-update-to-php-8/#post-16544846)
 * Hi Maybellyne, Thank you very much for your help with this, the solution you 
   have suggested has worked! I really appreciate it.
 *  [Skrabbel](https://wordpress.org/support/users/skrabbel/)
 * (@skrabbel)
 * [3 years ago](https://wordpress.org/support/topic/wordpress-database-error-when-update-to-php-8/#post-16549042)
 * Hello,
 * I have the same problem with version 20.2.1. But mysql service crashes when using
   Yoast Test Helper Plugin.
 * It looks like version 20.2. works.
    -  This reply was modified 3 years ago by [Skrabbel](https://wordpress.org/support/users/skrabbel/).

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

The topic ‘WordPress database error when update to PHP 8’ 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: [Skrabbel](https://wordpress.org/support/users/skrabbel/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/wordpress-database-error-when-update-to-php-8/#post-16549042)
 * Status: resolved