WordPress Blocks Post using the REST API

by Jun 16, 2023

Sending email to my subscribers is done by an automation flow.

In the last couple of days paragraphs in my emails started to disappear. It changed into one large blob of text which is very annoying to read. Sorry about this!

The automation depends on the RSS-feed of WordPress, where I keep an archive of my emails. After a change of the RSS-feed, it was only returning one big blob of text, no paragraphs.

Classic Block

My RSS-feed broke when a post was using the Classic Block from the Classic Editor. When converted to the blocks in the Block Editor it worked again.

Most of my posts, I create through the WordPress REST API. This uses the Classic Block for my post. I want to use the new blocks using the WordPress REST API.

There is a function in WordPress to convert the Classic Block Post to the new Blocks. You can use this function when posts are being made through the WordPress REST API, but that involved coding. I didn’t want to follow that route. My PHP skills are not up to date anymore.

Could I change what I’m posting to the WordPress REST API?

Yes, you can! By surrounding paragraph with the special WordPress <!– wp:paragraph –>, I could post it as Blocks! By transforming paragraphs like below, I could solve it.

 <p>Every Productivity book: How to finish tasks quickly!</p>

// transform to

<!-- wp:paragraph --> <p>Every Productivity book: How to finish tasks quickly!</p> <!-- /wp:paragraph -->

Zapier

I use an automation in Zapier to create a post in WordPress. I now have extended this automation by adding the Text Formatter to add this special tag to each paragraph.

The flow now looks like this:

This should save the problem for the future!

Remy van Duijkeren

Remy van Duijkeren

Power Platform Advisor

Microsoft Power Platform Advisor with over 25 years of experience in IT with a focus on (marketing) automation and integration.

Helping organizations with scaling their business by automating processes on the Power Platform (Dynamics 365).

Expert in Power Platform, Dynamics 365 (Marketing & Sales) and Azure Integration Services. Giving advice and strategy consultancy.

Services:
– Strategy and tactics advise
– Automating and integrating

Subscribe to
The Daily Friction

A daily newsletter on automation and eliminating friction

Related Content

Form Data OnLoad

Form Data OnLoad

You want to call Form OnLoad multiple times? Don't! I was reading about a blogpost to trigger the Form OnLoad multiple times. This should happen after the data was saved and/or refreshed. Why would you want this? Usually, the Form OnLoad contains logic to change the...

read more
Who is the target audience for Power Pages

Who is the target audience for Power Pages

Power Pages is slowly getting better and better product. But then I look at the pricing page: https://powerpages.microsoft.com/en-us/pricing/ Who is the target audience for this product? If you need something 'quick and dirty' it is nice to have a website up and...

read more
Power Pages Secure?

Power Pages Secure?

Power Pages! They tell me it's easy and is very secure, it's built in! I am not fully convinced when I hear this. Why? Simple said: "Easy and Security don't mix". Making something more secure will make it less easy to use. Data separation The thing is, Dataverse is...

read more