WordPress.org

Ready to get started?Download WordPress

Forums

Manually Publishing Posts (2 posts)

  1. dappleyard
    Member
    Posted 6 years ago #

    Hi.

    I have a queue of posts marked as Drafts, and I'd like to run a Cron Job to publish two of these automatically every morning.

    I just wondered what changes I need to make to the WordPress database with a script in order to make the two posts live?

    Thanks for your assistance

  2. Michael Fields
    Themer
    Posted 6 years ago #

    You would have to set "post_status" to "publish" and (if using permalinks) you will want to set a "post_name". This can be created by running the "post_title" through the sanitize_title_with_dashes() function.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.