How to apply content filter permanently?

//run once

$allposts = get_posts('post_status=publish&numberposts=-1');
foreach ($allposts as $thispost) {
     wp_update_post( array(
          'ID' => $thispost->ID,
          'post_content' => fix_zip_code($thispost->post_content)
          )
     );
}

But as Rarst mentioned, backup your database before doing anything…

Leave a Comment