• Resolved samlinck

    (@samlinck)


    We have a cron job running that fetches posts every hour from an api. This posts get published and the old ones get deleted by use of a sql query. The problem is that this old posts keep existing in the wp_yoast_seo_meta & wp_yoast_indexable tables. As a result this tables have a lot of rows and get very big. How can I safely delete the rows of the old posts?

    • This topic was modified 2 years, 10 months ago by samlinck.
Viewing 4 replies - 1 through 4 (of 4 total)
  • 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/

    Thread Starter samlinck

    (@samlinck)

    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?

    Plugin Support devnihil

    (@devnihil)

    @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.

    Plugin Support devnihil

    (@devnihil)

    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 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Old posts keep existing in yoast database tables’ is closed to new replies.