If you get content generated with the correct formatting commands, from ChatGPT or any other source, you can paste it into WordPress not as text, but as paragraphs, headings, lists, code, containers, quotes.
You can train ChatGPT to deliver a long article in pieces, and have special formatting for a piece. For example, a container with two columns, with text in the left column and an image on the right.
To train ChatGPT, I took examples of different blocks made by WordPress. I viewed a block in the Code Editor, copied it and pasted it into ChatGPT. After a few rounds of “no, I don’t want you to repeat this to me, this is the format I want you to learn” I got what I wanted.
(ChatGPT is like a naive genius child, it often doesn’t understand you, with a lot of words. So, ask a different way until you get what you want. Also, remember to use what it says as a 1st draft; you have to go over what it generates to make sure it wrote well, without misunderstanding you or including things you wouldn’t say.)
Along the way, I found that Heading level 2 uses one format,
<!-- wp:heading -->
,
but subheadings, with higher heading levels, require an additional parameter. For example an H3 heading needs this:<!-- wp:heading {"level":3} -->
(otherwise, the Block Editor has to “attempt recovery”).
Finally, ChatGPT gave me results I could paste directly into WordPress.
Then, I asked it to give a succinct way to instruct it what format I wanted.
It gave a good answer. Then I asked “Can you remember for my account, what “WordPress Block Editor format” is? Or should I paste what you said for each new article?”
You can use this to tell ChatGPT how you want it to output the article you are going to have it write.
Here’s what it said.
To specify the “WordPress Block Editor” format for future articles, you can follow these guidelines:
1. Use HTML comments to encapsulate each block. For example:
<!-- wp:heading -->
<!-- /wp:heading -->
2. Inside the opening block comment, specify the block type. For example:
<!-- wp:heading -->
3. To add attributes to a block, include them within the opening block comment. For example:
<!-- wp:heading {"level":3} -->
Using <!-- wp:heading {"level":3} -->
for H3 headings, <!-- wp:heading {"level":4} -->
for H4 headings, and <!-- wp:heading {"level":5} -->
for H5 headings is the correct syntax to set the appropriate heading levels in the WordPress Block Editor format.
4. Add content within each block using appropriate HTML tags. For example:
<!-- wp:paragraph -->
<p>This is a paragraph block.</p>
<!-- /wp:paragraph -->
5. Maintain proper indentation and spacing for better readability.
6. If you want to include multiple blocks within a container or column layout, nest the appropriate block comments and HTML tags accordingly.
7. Remember to refer to the WordPress Block Editor documentation for additional block types, attributes, and features that you can use to customize your content.
So, you don’t tell ChatGPT “write me an article on _____”. You say “write me an article on _____ in this tone of voice, with about this many words. I want the article formatted for the WordPress Block Editor, and here is how to do that: (and you paste that entire set of guidelines, all 7 points).
Leave a Reply
You must be logged in to post a comment.