Last active
August 14, 2023 16:30
-
-
Save dgwyer/039b0eca77bf526492e318a85fa3284e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Number of posts to create | |
posts=100 | |
# Paragraphs | |
p=2 | |
# Create new posts and pages with random Lorem ipsum content inside paragraph blocks | |
curl -N http://loripsum.net/api/$p | sed '/^$/d' | sed 's/^/<\!-- wp:paragraph -->/' | sed 's/$/<\!-- \/wp:paragraph -->/' | wp post generate --count=$posts --post_content |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that this is 'block friendly'. Which means that not only does it create posts with random sample Lorem Ipsum text, it also adds each paragraph fetched from the Lorem API to a Gutenberg paragraph block.
Otherwise, when you viewed each post the Lorem text is just added to a 'Classic' block which isn't what we want.
Result for each post is something like this.