![WP All Import Export Subset of Posts by Slug Array [code snippet]](https://i0.wp.com/bootstrapcreative.com/wp-bc/wp-content/uploads/2020/08/code-snippet.png?fit=1024%2C1024&ssl=1)
When performing a WordPress blog migration you sometimes just need to export a certain number of posts vs the entire collection. The easiest way I have found to do this is by performing a custom query using the list of posts by their url slug.
1 2 3 4 |
// WPQuery args for slugs - create array fro list https://delim.co/ 'post_type' => 'post', 'post_status' => array( 'publish' ), 'post_name__in' => array( 'slug-1','slug-2' ) |