• Resolved Dealer Solutions

    (@dealersolutions)


    Hello, I am creating new multisite blogs programmatically via the function wpmu_create_blog() (Yoast 19.7.1, WordPress 6.0.1)

    Part of my process involves a call to update_option(‘page_on_front’,$id) which at the time of execution, the yoast tables have yet to be created, and this fails due to yoast having a hook on “update_option_page_on_front” and the tables not existing.

    How can I programmatically trigger the creation of the tables? the standard call of “wp_initialize_site” does not trigger yoast to create the tables which is actioned from within wp_insert_site()

    the yoast tables do generate the first time I access this blog, but I want them created before that ideally

    edit: my current work around “hack” is to suppress “update_option_page_on_front” hook whilst I execute my update_options() call

    With thanks

    • This topic was modified 2 years, 6 months ago by Dealer Solutions. Reason: Adding a note about my current workaround
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @dealersolutions

    Thanks for reaching out. The Yoast SEO plugin creates the essential database tables during the plugin activation hooks. Unfortunately, we don’t offer such a deep level of technical support. However, you can look at the plugin code in GitHub repository to see our code base and find out more.

    Thread Starter Dealer Solutions

    (@dealersolutions)

    Thank you,

    I don’t think yoast should be trying to update data via that hook if the tables don’t exist yet then.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to create Yoast Databases programatically?’ is closed to new replies.