Support » Plugin: Yoast SEO » Recurring error ‘ancestor_id’ cannot be null

  • Resolved Iulia Cazan



    I saw there was a previous similar issue reported, but closed due to inactivity. This seems to be a recurring issue and I can replicate it easily, so can help with troubleshooting this, let me know how I can assist.

    I already checked and the table exists and has some data populated. Please see below the error.

    Thank you!

    WordPress database error Column ‘ancestor_id’ cannot be null for query INSERT INTO wp_yoast_indexable_hierarchy (indexable_id, ancestor_id, depth, blog_id) VALUES (’41’, NULL, ‘1’, ‘1’) made by require(‘wp-blog-header.php’), wp, WP->main, WP->parse_request, do_action_ref_array(‘parse_request’), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, do_action(‘wp_insert_post’), WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\Indexable_Post_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder->build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Hierarchy_Builder->build, Yoast\WP\SEO\Builders\Indexable_Hierarchy_Builder->save_ancestors, Yoast\WP\SEO\Repositories\Indexable_Hierarchy_Repository->add_ancestor, Yoast\WP\Lib\Model->save, Yoast\WP\Lib\ORM->save, Yoast\WP\Lib\ORM::execute

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Maybellyne


    Hello Lulia,

    We are sorry about that WordPress database error. We think that resetting the indexing tables on your site should solve this issue. Can you please follow these steps and check if the errors are resolved?:

    – Make sure the Yoast SEO plugin is activated.
    – Install & activate the Yoast Test Helper plugin.
    – Go to Tools -> Yoast Test
    – Hit the “Reset indexables & migrations” button
    – Click the “Start processing and speed up your site now” button in SEO > Tools.

    Please note that, while the above instructions are safe, we always recommend having a current, full backup of your site for safety reasons.

    Do let us know how it goes.

    Plugin Support devnihil


    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.