Title: Error while saving post
Last modified: September 21, 2021

---

# Error while saving post

 *  Resolved [satheeshrajv](https://wordpress.org/support/users/satheeshrajv/)
 * (@satheeshrajv)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-while-saving-post/)
 * Hi,
 * I’n getting below error while saving the post. Please help me to resolve it
 * `WordPress database error Duplicate entry '39002-38998' for key 'PRIMARY' for
   query INSERT INTO`wp_yoast_indexable_hierarchy`(`indexable_id`,`ancestor_id`,`
   depth`,`blog_id`) VALUES ('39002', '38998', '1', '1') made by do_action('wp_ajax_save-
   attachment'), WP_Hook->do_action, WP_Hook->apply_filters, wp_ajax_save_attachment,
   wp_update_post, wp_insert_attachment, wp_insert_post, do_action('edit_attachment'),
   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',
   referer: https://domain.com/wp-admin/post.php?post=88888&action=edit&classic-
   editor`
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-while-saving-post%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Maybellyne](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-while-saving-post/#post-14892633)
 * Hello Satheeshrajv,
 * We’re sorry to hear that you’re seeing errors on your website related to Yoast
   SEO. To troubleshoot the issue, we recommend resetting the Yoast indexables database
   tables by performing the following steps:
 * 1. Install & activate the [Yoast Test Helper](https://wordpress.org/plugins/yoast-test-helper/)
   plugin
    2. Go to Tools > Yoast Test 3. Hit the “Reset indexables & migrations”
   button. 4. Go to SEO -> Tools and under “Optimize SEO Data” click the “Start 
   SEO data optimization” button to rescan all your pages.
 * Do the errors still appear? We look forward to hearing from you.
 *  Thread Starter [satheeshrajv](https://wordpress.org/support/users/satheeshrajv/)
 * (@satheeshrajv)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-while-saving-post/#post-14892688)
 * Hi Maybellyne,
 * How long will this process run?. I’m having thousands of pages in my site. Will
   it affect my site performance?
 * Regards,
    Satheeshraj V
 *  Plugin Support [Maybellyne](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-while-saving-post/#post-14892783)
 * Hello Satheeshraj,
 * If you have a large site, this may take some time. However, you can 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. **Since you have a large site, we highly recommend this 
   method.**
 * If the optimization completes successfully after the reset, the error should 
   be resolved.
 *  Thread Starter [satheeshrajv](https://wordpress.org/support/users/satheeshrajv/)
 * (@satheeshrajv)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-while-saving-post/#post-14894007)
 * Is there any other short way to do it. Will it be ok if I uninstall and reinstall
   the Yoast plugin.
 *  Plugin Support [Maybellyne](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-while-saving-post/#post-14894104)
 * Hello Satheeshraj,
 * The easiest way is to use the WP-CLI commands. Uninstalling and reinstalling 
   does not make any difference in this case.
 * Thanks
 *  [devnihil](https://wordpress.org/support/users/devnihil/)
 * (@devnihil)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-while-saving-post/#post-14925365)
 * 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 6 replies - 1 through 6 (of 6 total)

The topic ‘Error while saving post’ 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
 * 3 participants
 * Last reply from: [devnihil](https://wordpress.org/support/users/devnihil/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/error-while-saving-post/#post-14925365)
 * Status: resolved