Gold Penguin Logo with Text

Remove Paragraph Tags from WordPress Excerpt using Zapier's Strip HTML Formatter

Eliminate unwanted HTML tags from your WordPress excerpts through Zapier before posting articles across social media like Twitter or LinkedIn
Updated August 13, 2023

When automating your WordPress posts to Twitter via Zapier, it's crucial to ensure the content looks clean and engaging. One common hiccup users face is when the WordPress excerpt in Zapier contains unwanted HTML tags like <p> and </p>.

I initially ran into this when I was trying to send my WordPress posts to LinkedIn, and was having trouble pulling in data like images and excerpts.

Thankfully, there's a straightforward solution to this:

Using the Zapier formatter to strip out the HTML.

The Issue:

You've set up a Zap to trigger every time a new post is published on your WordPress blog. This Zap is supposed to send a Tweet containing a brief excerpt from your post, the link to the blog post, and a featured image. However, you notice that the excerpt in the Tweet contains HTML tags, making it look unprofessional.

The Solution:

Strip HTML from the Excerpt:To remove any HTML from the excerpt, you can add a 'Formatter' step in your Zap. Zapier's 'Formatter' tool can strip away any HTML tags from your excerpt, leaving you with clean, plain text. Here's how to do it:

  • After setting up your WordPress trigger, click on '+ Add a Step'.
  • Choose 'Formatter by Zapier'.
  • Set the action event to 'Text'.
  • You'll then get an option to 'Transform' the text. Choose 'Strip HTML' from the dropdown.
  • In the 'Input' field, select the WordPress excerpt. This will apply the transformation only to the excerpt and not the entire post.
  • Test this step to ensure the HTML tags are removed from your excerpt.

And that's it. You'll now have a rendered excerpt that doesn't contain the <p> or </p> tags anymore. Hope this helped! Drop a comment if you have any questions!

Want To Learn Even More?
If you enjoyed this article, subscribe to our free monthly newsletter
where we share tips & tricks on how to use tech & AI to grow and optimize your business, career, and life.
Reading Time: 2 minutes
Written by Justin Gluska
Justin is the founder of Gold Penguin, a business technology blog that helps people start, grow, and scale their business using AI. The world is changing and he believes it's best to make use of the new technology that is starting to change the world. If it can help you make more money or save you time, he'll write about it!
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
Join Our Newsletter!
If you enjoyed this article, subscribe to our newsletter where we share tips & tricks on how to make use of some incredible AI tools that you can use to grow and optimize a business
magnifiercross