• Resolved zuk22

    (@zuk22)


    Hi guys
    What is the better way to update large amount of posts and minify server load?
    Using wp_update_post is good way or not?

Viewing 5 replies - 1 through 5 (of 5 total)
  • What do you want to update in the posts?

    Thread Starter zuk22

    (@zuk22)

    title, description and few metafields

    Sorry, I should have said what and how do you want to update the posts?

    For example if you’re updating all titles to add a prefix, I would do that with a single mysql command: UPDATE wp_posts SET post_title = CONCAT(‘My Prefix ‘, post_title);

    However if this is a more customized update, I would write a script that updates 10 to 20 rows, then sleeps for 1 second, then continue.

    There’s nothing wrong with wp_update_post, but be aware that it will delete custom post meta if there is any.

    Thread Starter zuk22

    (@zuk22)

    Thank for advice)

    Thread Starter zuk22

    (@zuk22)

    Resolved

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp_update_post large amount of data’ is closed to new replies.