#!/bin/bash for post_id in $(wp post list --post_status=advanced --format=ids); do wp post update $post_id --post_status=publish; done;