WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Update all posts at the same time (7 posts)

  1. Matt
    Member
    Posted 4 years ago #

    I was hoping to be able to update all posts at one time. the reason is i added a new function that would allow for recognition of line breaks but in order for that to be applied to the field i need to update the posts.

    So instead of one by one I would like to do a site wide post update.

    Thanks,

    Matt

  2. vtxyzzy
    Member
    Posted 4 years ago #

    Can you give more detail of exactly what you need to update in the posts? The answer to your question may vary greatly depending on the exact update needed.

  3. Matt
    Member
    Posted 4 years ago #

    I need to update a custom field for every post that I have published.

    Thanks

  4. Matt
    Member
    Posted 4 years ago #

    What I have done is create a custom Meta Box for the admin post page. The problem was when adding content to the field the textarea was not recognizing linebreaks. since then I have added a function add a <br /> after each line break.

    In order to update every post I will need to do this manually one by one. So thats why i am asking if there would be a way to update all posts at once.

    The bulk action option is not a solution for me. a new revision needs to be made for the post in order for it to reflect on the front end.

  5. vtxyzzy
    Member
    Posted 4 years ago #

    So if I understand, the text you need to update is in a custom field? If that is correct, you need to update the postmeta table meta_value for certain meta_key values. Correct?

    If the update cannot be accomplished by a MySQL query, you will need to write a php module to do the updates. Is it easy to describe what your function does? Or if the function is short, just post it here?

  6. Matt
    Member
    Posted 4 years ago #

    You know i'm already just going into the posts 1 by 1 and just clicking update... Thanks!

  7. vtxyzzy
    Member
    Posted 4 years ago #

    OK. Please mark this topic 'Resolved'.

Topic Closed

This topic has been closed to new replies.

About this Topic