[ 'page', 'post' ], 'post_status' => 'any', 'posts_per_page' => -1, 'meta_key' => '_oribi_sync_checksum', 'fields' => 'ids', ] ); foreach ( $posts as $post_id ) { delete_post_meta( $post_id, '_oribi_sync_checksum' ); delete_post_meta( $post_id, '_oribi_sync_git_sha' ); delete_post_meta( $post_id, '_oribi_sync_source' ); delete_post_meta( $post_id, '_oribi_sync_last_run' ); delete_post_meta( $post_id, '_oribi_sync_last_push' ); delete_post_meta( $post_id, '_oribi_sync_pr_url' ); } // Remove origin src meta from media attachments $attachments = get_posts( [ 'post_type' => 'attachment', 'post_status' => 'any', 'posts_per_page' => -1, 'meta_key' => '_oribi_sync_origin_src', 'fields' => 'ids', ] ); foreach ( $attachments as $att_id ) { delete_post_meta( $att_id, '_oribi_sync_origin_src' ); } // Clear any scheduled cron wp_clear_scheduled_hook( 'oribi_sync_cron_run' );