Title: WordPress database error Duplicate entry &amp; Deadlock found
Last modified: August 16, 2023

---

# WordPress database error Duplicate entry & Deadlock found

 *  Resolved [ignitionmedia](https://wordpress.org/support/users/ignitionmedia/)
 * (@ignitionmedia)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-deadlock-found/)
 * Hi there
 * My error log is 70mb due to Yoast errors. Nothing I have tired will stop these
   errrors. We’re using PHP 8.0, Yoast 20.13, and WP 6.3.
 * I have already installed the Yoast Test plugin and clicked “Reset Indexables 
   tables & migrations” – this has not fixed the issue. Can anyone help??
 * Below is one example:
 * [16-Aug-2023 04:21:39 UTC] WordPress database error Duplicate entry ’22-0′ for
   key ‘PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (’22’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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
   [
   16-Aug-2023 04:22:24 UTC] WordPress database error Deadlock found when trying
   to get lock; try restarting transaction for query UPDATE w4pw_actionscheduler_actions
   SET attempts = attempts+1, status=’in-progress’, last_attempt_gmt = ‘2023-08-
   16 04:21:59’, last_attempt_local = ‘2023-08-16 14:21:59’ WHERE action_id = 222987
   made by do_action_ref_array(‘action_scheduler_run_queue’), WP_Hook->do_action,
   WP_Hook->apply_filters, ActionScheduler_QueueRunner->run, ActionScheduler_QueueRunner-
   >do_batch, ActionScheduler_Abstract_QueueRunner->process_action, ActionScheduler_DBStore-
   >log_execution
    -  This topic was modified 2 years, 9 months ago by [ignitionmedia](https://wordpress.org/support/users/ignitionmedia/).

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

 *  Plugin Support [Maybellyne](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-deadlock-found/#post-16979706)
 * Hello [@ignitionmedia](https://wordpress.org/support/users/ignitionmedia/)
 * I’m sorry about the persistent WordPress database errors. Inspecting the error
   details, some issues occurred during data insertion into the database table while
   indexing. You mentioned using the Yoast Test Helper plugin before. Can you please
   try again?
    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.
 * Do let me know how it goes.
 *  Thread Starter [ignitionmedia](https://wordpress.org/support/users/ignitionmedia/)
 * (@ignitionmedia)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-deadlock-found/#post-16987478)
 * Unfortunately, this hasn’t helped – if anything, it is now worse as it is also
   causing fatal errors, using all memory. Is there something else we can try?
 * [20-Aug-2023 21:34:32 UTC] WordPress database error Duplicate entry ’22-0′ for
   key ‘PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (’22’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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
   [
   20-Aug-2023 21:34:32 UTC] WordPress database error Duplicate entry ’23-0′ for
   key ‘PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (’23’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[20-
   Aug-2023 21:34:32 UTC] WordPress database error Duplicate entry ’24-0′ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (’24’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[20-
   Aug-2023 21:34:32 UTC] WordPress database error Duplicate entry ’25-0′ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (’25’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[20-
   Aug-2023 21:34:32 UTC] WordPress database error Duplicate entry ‘3-0’ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (‘3’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[20-
   Aug-2023 21:34:32 UTC] WordPress database error Duplicate entry ‘4-0’ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (‘4’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[20-
   Aug-2023 21:34:32 UTC] WordPress database error Duplicate entry ‘5-0’ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (‘5’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[20-
   Aug-2023 21:34:32 UTC] WordPress database error Duplicate entry ‘6-0’ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (‘6’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[20-
   Aug-2023 21:34:33 UTC] WordPress database error Duplicate entry ‘9-0’ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (‘9’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[20-
   Aug-2023 21:34:33 UTC] WordPress database error Duplicate entry ’10-0′ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (’10’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[20-
   Aug-2023 21:35:02 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes
   exhausted (tried to allocate 20480 bytes) in /home/wastecom/public_html/wp-includes/
   class-wpdb.php on line 2425[20-Aug-2023 21:37:27 UTC] PHP Fatal error: Allowed
   memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /
   home/wastecom/public_html/wp-includes/class-wpdb.php on line 2425[20-Aug-2023
   21:38:41 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted(
   tried to allocate 20480 bytes) in /home/wastecom/public_html/wp-includes/class-
   wpdb.php on line 2425
 *  Plugin Support [Maybellyne](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-deadlock-found/#post-16989434)
 * Is there a difference if you turn OFF the Insights and Text link counter feature
   in _WordPress > Yoast SEO > Settings > General > Site Features_?
 *  Thread Starter [ignitionmedia](https://wordpress.org/support/users/ignitionmedia/)
 * (@ignitionmedia)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-deadlock-found/#post-16990202)
 * No 🙁 it still spits out errors by the minute. Is there anything else we can 
   try?
 * [21-Aug-2023 18:38:32 UTC] WordPress database error Duplicate entry ‘1-0’ for
   key ‘PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (‘1’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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
   [
   21-Aug-2023 18:38:35 UTC] WordPress database error Duplicate entry ‘9-0’ for 
   key ‘PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (‘9’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[21-
   Aug-2023 18:38:38 UTC] WordPress database error Duplicate entry ’21-0′ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (’21’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[21-
   Aug-2023 18:38:42 UTC] WordPress database error Duplicate entry ’23-0′ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (’23’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[21-
   Aug-2023 18:38:43 UTC] WordPress database error Duplicate entry ’26-0′ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (’26’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[21-
   Aug-2023 18:38:43 UTC] WordPress database error Duplicate entry ’27-0′ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (’27’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[21-
   Aug-2023 18:38:44 UTC] WordPress database error Duplicate entry ‘1-0’ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (‘1’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[21-
   Aug-2023 18:38:45 UTC] WordPress database error Duplicate entry ‘3-0’ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (‘3’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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[21-
   Aug-2023 18:38:45 UTC] WordPress database error Duplicate entry ‘5-0’ for key‘
   PRIMARY’ for query INSERT INTO `w4pw_yoast_indexable_hierarchy` (`indexable_id`,`
   ancestor_id`, `depth`, `blog_id`) VALUES (‘5’, ‘0’, ‘0’, ‘1’) made by require(‘
   wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook-
   >apply_filters, capitalize_tag_names, wp_update_term, do_action(‘edited_term’),
   WP_Hook->do_action, WP_Hook->apply_filters, Yoast\WP\SEO\Integrations\Watchers\
   Indexable_Term_Watcher->build_indexable, Yoast\WP\SEO\Builders\Indexable_Builder-
   >build_for_id_and_type, Yoast\WP\SEO\Builders\Indexable_Builder->build, 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
 *  Plugin Support [Maybellyne](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-deadlock-found/#post-16991882)
 * I’m sorry the errors continue. Can you retry resetting SEO data once again and
   retrying the optimization via the WP CLI approach? This has helped some users
   in the past. To reset the data, please follow these steps:
    - Install & activate the [Yoast Test Helper](https://wordpress.org/plugins/yoast-test-helper/)
      plugin
    - Go to your WordPress admin dashboard > Tools (sidebar) > Yoast Test
    - 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 each reset was successful.
 * Now that we have removed any previously stored data, **use the [WP-CLI commands](https://developer.yoast.com/blog/yoast-seo-wp-cli-index-command/).**
   This requires access to your server through a terminal service. Your web host
   may be able to help. If you have a large site, we highly recommend this method.
 *  [Jeroen Rotty](https://wordpress.org/support/users/jeroenrotty/)
 * (@jeroenrotty)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-deadlock-found/#post-17008496)
 * This thread was marked resolved due to a lack of activity, but you’re always 
   welcome to re-open the topic. Please read [this post](https://wordpress.org/support/topic/read-this-before-your-post/)
   before [opening a new request](https://wordpress.org/support/plugin/wordpress-seo#new-post).

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

The topic ‘WordPress database error Duplicate entry & Deadlock found’ 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/)

## Tags

 * [Database Error](https://wordpress.org/support/topic-tag/database-error/)

 * 6 replies
 * 3 participants
 * Last reply from: [Jeroen Rotty](https://wordpress.org/support/users/jeroenrotty/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-deadlock-found/#post-17008496)
 * Status: resolved