Hello @neo2k23,
Thanks for sharing the error. It suggests that the Yoast SEO database table wp_yoast_seo_links might be missing or inaccessible. Could you please let us know:
- Which version of Yoast SEO you’re using?
- Whether the site was recently migrated, restored from a backup, or updated?
- If running Yoast SEO → Tools → Start SEO data optimization completes successfully?
Also, please check whether the wp_yoast_seo_links table exists in your database and let us know what you find.
Hi
Thank you for your fast reply. I am using the latest version. I get this error on database optimization.
<div id="error"><p class="wpdberror"><strong>WordPress database error:</strong> [Table 'server_db.wp_yoast_seo_links' doesn't exist]<br /> SELECT P.ID, P.post_content FROM wp_posts AS P WHERE P.post_status = 'publish' AND P.post_type IN ('post', 'page', 'e-floating-buttons', 'elementskit_content', 'elementskit_template', 'elementskit_widget', 'product', 'bdt-template-builder', 'portfolio') AND ( NOT EXISTS ( SELECT 1 FROM wp_yoast_indexable AS I WHERE I.object_id = P.ID AND I.link_count IS NOT NULL AND I.object_type = 'post' ) OR EXISTS ( SELECT 1 FROM wp_yoast_seo_links AS L WHERE L.post_id = P.ID AND L.target_indexable_id IS NULL AND L.type = 'internal' AND L.target_post_id IS NOT NULL AND L.target_post_id != 0 ) ) LIMIT 5</p></div>{"objects":[],"next_url":false}
The table wp_yoast_seo_links does not exist in the database. How is this possible? There was no database restore. Is there a way to have the table recreated?
I just tried the following…. I backupped the current database and deleted the yoast seo plugin. Then i followed these steps as the yoast tables and options were not deleted. https://yoast.com/help/how-can-i-uninstall-my-plugin/#database
After that i reinstalled yoast seo and activated it. I got even more errors on database optimization. So i imported back the database exported before trying this. Its a localhost install so its impossible to give you access.
Any idea left to take to get this working?
Thank you
I recreated the missing table from another new clean website. It seems to fix the issue.
I get “SEO data optimization complete” in a green box.
Thanks for letting us know the issue has been resolved.
@maybellyne well it is not the way it should be fixed do you think? When a table is missing the plugin should just recreate the table. The tables were also not recreated after following these steps.
https://yoast.com/help/how-can-i-uninstall-my-plugin/#database
So apparently yoast is doing something else. Try it yourself. Turn off the plugin and delete it. Delete all tables and all traces for wpseo and wp_yoast. Then reinstall the plugin and goto its settings… You will see a lot of missing tables errors.
This is not ok i guess. What do you think about it?
Looking forward to your reply.
There are more troubleshooting steps I didn’t share since you confirmed the issue was fixed for you. Please try the following:
- Install & activate the Yoast Test Helper plugin
- Go to Tools > 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 the specific reset was successful.
- Go to Admin > Yoast SEO > Tools
- 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.
@maybellyne i will test next week and get back to you on this if that resolves the issue. Since i have a database backup i can easily test this.