Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-plugin-wordpress-parser

Description

Adds custom replacement rules (see Contact Form 7)

How to Use

Wherever you need to display the post content:

import ContentParser from "gatsby-plugin-wordpress-parser";

replace <div dangerouslySetInnerHTML={{ __html: content }} /> with this

<div>
  <ContentParser content={content} />
</div>

How to Extend for Contact Form 7

Use gatsby-plugin-wpcf7

import ContentParser from "gatsby-plugin-wordpress-parser";
import { cf7ParserFunction } from "gatsby-plugin-wpcf7";

replace <div dangerouslySetInnerHTML={{ __html: content }} /> with:

<div>
  <ContentParser content={content} customFn={[cf7ParserFunction]} />
</div>
© 2023 Gatsby, Inc.