Pavan G R
Pavan G R

Reputation: 1

How to Integrate a WordPress Blog Page into a Next.js Route with a Node.js Backend?

I have a Next.js project where I want to display a specific WordPress page for blog posts. For example, on the route blogs, I want to show a WordPress page containing blog information related to that product below the main info. The rest of the pages should remain in Next.js. I need this int

I have explored a few options for integrating WordPress content into my Next.js project:

  1. Using the WordPress REST API: I tried fetching the blog content from the WordPress REST API and rendering it in my Next.js component. However, I found it challenging to seamlessly integrate the WordPress content and maintain the SEO benefits that WordPress offers.

  2. iFrame Integration: I considered embedding the WordPress blog page using an iFrame, but this approach doesn't provide a smooth user experience and limits the ability to style the content consistently with the rest of my Next.js application.

  3. Headless WordPress: I looked into using WordPress as a headless CMS with a custom front-end in Next.js, but I am not sure how to implement this in a way that preserves the SEO features of WordPress specifically for the blog page.

I am expecting to find a solution that allows me to:

Are there any recommended approaches or libraries that can help me achieve this?

Upvotes: 0

Views: 569

Answers (1)

Edward
Edward

Reputation: 1

I would definitly use the wp-rest api. To get more possibilities to render the Gutenberg blocks with React Components I've created a plugin called Headless which extends the rest api post responses. That works very well in my WordPress with Next.js projects. You can use my starterkit for this type of WordPress + Next.js Setup if want to: https://github.com/EdwardBock/wordpress-nextjs-starterkit

Upvotes: 0

Related Questions