Title: WordPress database error Duplicate entry
Last modified: March 16, 2022

---

# WordPress database error Duplicate entry

 *  Resolved [adampoly](https://wordpress.org/support/users/adampoly/)
 * (@adampoly)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-15/)
 * Yoast 18.3 is appearing in the error_log file with multiple errors like this.
   What do they mean, and how can they be fixed? Only started since update to 18.3.
 * `[15-Mar-2022 08:12:30 UTC] WordPress database error Duplicate entry '1305-0'
   for key 'PRIMARY' for query INSERT INTO`wp_yoast_indexable_hierarchy`(`indexable_id`,`
   ancestor_id`,`depth`,`blog_id`) VALUES ('1305', '0', '0', '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->get_item, WP_REST_Attachments_Controller->prepare_item_for_response,
   WP_REST_Posts_Controller->prepare_item_for_response, WP_REST_Controller->add_additional_fields_to_object,
   Yoast\WP\SEO\Routes\Yoast_Head_REST_Field->for_post, Yoast\WP\SEO\Actions\Indexables\
   Indexable_Head_Action->for_post, Yoast\WP\SEO\Actions\Indexables\Indexable_Head_Action-
   >with_404_fallback, Yoast\WP\SEO\Surfaces\Values\Meta->get_head, Yoast\WP\SEO\
   Surfaces\Values\Meta->create_html_presentation, Yoast\WP\SEO\Presenters\Schema_Presenter-
   >present, Yoast\WP\SEO\Presenters\Schema_Presenter->get, Yoast\WP\SEO\Presentations\
   Abstract_Presentation->__get, Yoast\WP\SEO\Presentations\Indexable_Presentation-
   >generate_schema, Yoast\WP\SEO\Generators\Schema_Generator->generate, Yoast\WP\
   SEO\Generators\Schema_Generator->generate_graph, Yoast\WP\SEO\Generators\Schema\
   Breadcrumb->generate, Yoast\WP\SEO\Presentations\Abstract_Presentation->__get,
   Yoast\WP\SEO\Presentations\Indexable_Presentation->generate_breadcrumbs, Yoast\
   WP\SEO\Generators\Breadcrumbs_Generator->generate, Yoast\WP\SEO\Repositories\
   Indexable_Repository->get_ancestors, Yoast\WP\SEO\Repositories\Indexable_Hierarchy_Repository-
   >find_ancestors, 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 6 replies - 1 through 6 (of 6 total)

 *  Plugin Support [Maybellyne](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-15/#post-15464526)
 * Hello Adam,
 * We are sorry about that WordPress database error. It seems the error occurred
   during data insertion into the database table while indexing. Can you please 
   try resetting our indexables in the database tables by following the steps below?
 * 1. Install & activate the [Yoast Test Helper](https://wordpress.org/plugins/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 each reset was successful. Note: Resetting the optimization doesn’t
   undo any of the hard work you’ve put into the plugin as the SEO data is also 
   stored in WordPress’ default tables. It’ll just reset the custom Yoast tables
   that contain the combined data pulled from those default tables. 4. Go to SEO
   > Tools, and under SEO data, click the “Start SEO data optimization” button to
   allow Yoast to rescan your content.
 * For your site’s health and safety, we recommend creating regular backups of your
   site and database. This is especially important before making important changes
   on your website.
 *  Thread Starter [adampoly](https://wordpress.org/support/users/adampoly/)
 * (@adampoly)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-15/#post-15464538)
 * Thank you [@maybellyne](https://wordpress.org/support/users/maybellyne/)
 * We have tried this. This error reoccurs each time we publish a post. The time
   of the error always equals the time of the post being published. We have observed
   this in 2 sites, and only since Yoast 18.3
 *  Plugin Support [Michael Tiña](https://wordpress.org/support/users/mikes41720/)
 * (@mikes41720)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-15/#post-15467400)
 * Hi,
 * Just to clarify, you’ve already reset the indexables using the Yoast Test Helper
   plugin and completed the SEO data optimization process again, right?
 * And you still get this error every time you publish a new post after finishing
   the said process?
 * Could you check if you are still able to reproduce this error even with just 
   a default WP theme and only Yoast SEO 18.3 as the plugin enabled?
 *  Thread Starter [adampoly](https://wordpress.org/support/users/adampoly/)
 * (@adampoly)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-15/#post-15467960)
 * Hi
 * Yes, I have already reset the indexables using the Yoast Test Helper plugin and
   completed the SEO data optimization process again.
 * The error doesn’t happen if I used wp-rollback to go back to 18.2.
 * Upgrading back to 18.3 it resurfaces. Resetting indexables onces doesn’t fix 
   it. However, after resetting the indexables a few times, it appears to fix it.
   But after a few posts comes back.
 *  Plugin Support [Michael Tiña](https://wordpress.org/support/users/mikes41720/)
 * (@mikes41720)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-15/#post-15470912)
 * Hi [@adampoly](https://wordpress.org/support/users/adampoly/)
 * Upon checking the [changelog](https://yoast.com/wordpress/plugins/seo/change-log-wordpress-seo/),
   we don’t see any changes relating to the database tables from 18.2 to 18.3 that
   would explain this issue.
 * There was an older GitHub issue [here](https://github.com/Yoast/wordpress-seo/issues/15472),
   but it was already closed after suggesting the reindexing with the Yoast Test
   Helper plugin.
 * If this still occurs with just a default WP theme and only the Yoast SEO 18.3
   plugin, we suggest logging a bug report here – [https://yoast.com/help/how-to-write-a-good-bug-report/](https://yoast.com/help/how-to-write-a-good-bug-report/)
 *  [Jeroen Rotty](https://wordpress.org/support/users/jeroenrotty/)
 * (@jeroenrotty)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-15/#post-15494555)
 * I marked this thread as resolved due to a lack of activity by the original poster.
   The original poster is always welcome to re-open this topic.
 * If you are not the original poster but have a similar issue, 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’ 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/)

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