Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $sql = mysql_query("
- SELECT id
- FROM fc_wp_posts
- WHERE post_type = 'post'
- AND post_status = 'publish'
- ");
- while ($postname = mysql_fetch_array($sql)) {
- $id = $postname['id'];
- $postdata = array();
- $postdata['ID'] = $postname['id'];
- $postdata['post_name'] = '';
- $p = wp_update_post( $postdata );
- $num++;
- if ( is_wp_error( $p ) ) {
- echo 'Encountered error: ' . $p->get_error_message();
- } else {
- echo '# ' . $num . ' | Successfully updated<br />';
- }
- }
Add Comment
Please, Sign In to add comment