Sample — test — data for large WordPress install

Few built-in wp-cli generate commands from the docs: # Generate posts with fetched content. # See https://developer.wordpress.org/cli/commands/post/generate/ $ curl -N http://loripsum.net/api/5 | wp post generate –post_content –count=10 # Add meta to every generated term. # See https://developer.wordpress.org/cli/commands/term/generate/ $ wp term generate category –format=ids –count=3 | xargs -d ‘ ‘ -I % wp term meta add … Read more

How can I export and then import posts with featured images?

You can consult this answer, but the instructions are a bit unclear, so I’ll clarify them myself here. On the old blog, export the posts using the standard WordPress import/export functionality. If you’re unfamiliar with that, see this link for more information: https://codex.wordpress.org/Importing_Content On the new blog, use the WP Importer to import the XML … Read more

Update Custom Field on Imported Post Creation

There is a hook that worked for me in most case while those 3 hooks you use fail. It’s transition_post_status : add_action(‘transition_post_status’, ‘sterilize_vehicle_information’, 10, 3); function sterilize_vehicle_information( $post, $new_status, $old_status) { $internet_price = get_field(‘internet_price’,$post->ID); if( $new_status == ‘publish’ && old_status != ‘publish’ ) { update_post_meta( $post->ID, ‘internet_price’, preg_replace( “/[^0-9]/”, “”, $internet_price ) ); } } … Read more