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

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
Improving the Form Switcher

Improving the Form Switcher

In Microsoft Dynamics 365, Model Driven Apps in the Power Platform, you can create multiple main forms for the same table or TOFKAE (The Object Formally Known As Entity). When to use multiple forms This can be handy because you can assign different security roles to...

read more
How to use Environment Variables in your plugins

How to use Environment Variables in your plugins

Environment Variables Dynamics 365 / Power Apps solution can have Environment Variables. Often a Settings table (=entity) would be created to store configuration settings that differ between environments. We now can replace these with environment variables. These...

read more