Hey @samlinck,
I understand you are using a customized SQL query that removes older posts within a cron schedule.
While we can’t help you out with custom code, we’d recommend enhancing your SQL queries to include the removal of the indexables that tie to the post IDs that get deleted in your existing queries. You might also want to have a look at our developer documentation on https://developer.yoast.com/
I just found out that wp_yoast_seo_meta is a deprecated table, so that problem is fixed. Would it be possible to make a cron job that runs this wp CLI command once in a while “wp yoast index –reindex”? Can this be harmful? Or would you recommend to run an sql command that removes the old posts from the “wp_yoast_indexable” & “wp_yoast_indexable_hierarchy” table?
@samlinck Regarding creating a cron job that would run wp yoast index --reindex at a specified time interval, this isn’t something we would recommend unless this is for a small site with not very many pages. The --reindex option removes all existing indexables and then reindexes them so this has the potential to be resource intensive.
We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.