Archived topic
Convert Gutenberg Paragraph to Generateblock Paragraph
4 replies · Started by Philipp on September 9, 2020
Hello!
is there a way to convert all 200 posts/pages from gutenberg paragraphs to generateblock paragraphs?
thank you!!!
Hi Philipp,
GenerateBlocks doesn't have its own paragraph block. It uses Gutenberg editor's default paragraph and heading blocks for its text contents.
Perhaps what you mean was Gutenberg columns.
Currently, there's no way to automatically convert posts and pages from Gutenberg columns to GenerateBlocks Columns. I'm afraid you've have to edit all posts and pages layouts from the default Gutenberg columns to GB columns manually.
Hey Elvin,
thanks for your reply.
You are of course right. I was referring to the Generateblocks headline block with the paragraph element. Btw. why is it called headline instead of text block?
"There is no way?" that's an answer I'm not used to on the generatepress support forum ;)
At first I thought it would be a simple search and replace... except its not :/
What I have tried is replacing
<!-- wp:paragraph -->
<!-- /wp:paragraph -->
with
<!-- wp:generateblocks/headline {"element":"p"} -->
<!-- /wp:generateblocks/headline -->
And was hoping Wordpress wouldn't complain about the change - it does. And offers me to fix the corrupted paragraphs. At leas that saves we 3 clicks for each paragraph.
There has to be some kind of wp-cli command/php-snippet to just auto-fix all corrupted blocks?
That's one way to do it for sure.
Search for:
<!-- wp:paragraph -->
Replace with:
<!-- wp:generateblocks/headline {"element":"p"} -->
Search for:
<!-- /wp:paragraph -->
Replace with:
<!-- /wp:generateblocks/headline -->
Thank you Tom.
That's what I did and what caused wordpress to complain about corruption.
I have skipped moving to generateblocks paragraphs for now.