How to update all post content in WP ?

Discussion in 'Databases' started by z80039, Oct 28, 2008.

  1. #1
    Hi ,
    I have a wordpress video site and I need to change all the width of the posts . Can anyone give the sql code to update the content so that I can change the width from x to y ?

    Thanks
     
    z80039, Oct 28, 2008 IP
  2. justinlorder

    justinlorder Peon

    Messages:
    4,160
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do you want to add more content to old post ?
    If you are going to add the different contents to different posts , I think there is no shortcut.
    You have to update the post one by one.
     
    justinlorder, Oct 28, 2008 IP
  3. z80039

    z80039 Well-Known Member

    Messages:
    517
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    130
    #3
    I need to update the posts content.
    For example the post had the content : The boy is big.
    I need to cancel big and put "weird".
     
    z80039, Oct 28, 2008 IP
  4. greny

    greny Peon

    Messages:
    162
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That's how you replace the posts content:

    UPDATE wp_posts SET post_content = REPLACE (post_content, "big", "weird");

    Or the posts titles:

    UPDATE wp_posts SET post_title = REPLACE (post_title, "big", "weird");
     
    greny, Nov 6, 2008 IP