• Resolved Platoscave

    (@platoscave)


    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 2 years ago by Platoscave.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @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?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
    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

    (@platoscave)

    Hi Maybellyne, Thank you very much for your help with this, the solution you have suggested has worked! I really appreciate it.

    Skrabbel

    (@skrabbel)

    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 2 years ago by 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.