How create post using WP-CLI at time of network site create. I am creating network sites using WP-CLI.
I have tried:

wp post create --post_type=page --post_title="ABC" --post_status=publish --network

But it creates post on main site. But, I want to create that post on network site which was created that time.

Thanks in advance.
Any reference will be helpful.

2 Answers
2

You can try the --url argument to target a given site in your network:

wp post create \
   --post_type=page \ 
   --post_title="ABC" \
   --post_status=publish \
   --url=http://example.tld/somesite/

where you can view available site urls with

wp site list

Leave a Reply

Your email address will not be published. Required fields are marked *