Automatic Refresh all posts at once
you can do something like this: $args = array( ‘posts_per_page’ => 1000, ‘post_type’ => ‘post’ ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $casa_id = $post->ID; update_post_meta($post->ID, ‘casa_id’, $casa_id); } }