Skip to content

This project demonstrates how to use WordPress as a headless CMS with Next.js. It leverages Advanced Custom Fields (ACF) to manage custom data in WordPress and fetches this data via the WPGraphQL plugin to render content on the Next.js frontend.

Notifications You must be signed in to change notification settings

johnlomat/wordpress-headless-cms-next-js

Repository files navigation

WordPress Headless CMS with Next.js

This project demonstrates how to use WordPress as a headless CMS with Next.js. It leverages Advanced Custom Fields (ACF) to manage custom data in WordPress and fetches this data via the WPGraphQL plugin to render content on the Next.js frontend.

Introduction

This project uses WordPress as a headless CMS, where WordPress manages the content and Next.js handles the frontend rendering. By using ACF, you can create custom fields and structures within WordPress and then fetch this data using the WPGraphQL plugin.

Features

  • WordPress as a Headless CMS: WordPress is used solely for content management, with the frontend entirely decoupled.
  • Advanced Custom Fields (ACF): Utilize ACF to define and manage custom data fields within WordPress.
  • Next.js for Server-side Rendering (SSR) and Static Site Generation (SSG): Next.js provides flexibility in rendering strategies to optimize performance.
  • Data Fetching from WPGraphQL: Fetch content and custom data from WordPress via its GraphQL endpoints.
  • Responsive and Modern UI: Design and implement a responsive user interface leveraging Next.js and Tailwind CSS.
  • Metadata Management with Next.js: Use Next.js Metadata API to manage SEO and social media metadata for improved search engine visibility and social sharing.

Requirements

  • WordPress installation (self-hosted or managed)
  • Advanced Custom Fields (ACF) plugin
  • WPGraphQL plugin
  • Node.js (version 20 or higher)
  • npm or yarn package manager

Performance

Landing page desktop

Landing page pagespeed desktop result

Landing page mobile

Landing page pagespeed mobile result

Product category page desktop

Product category pagespeed desktop result

Product category page mobile

Product category pagespeed mobile result

Product page desktop

Product page pagespeed desktop result

Product page mobile

Product page pagespeed mobile result

About

This project demonstrates how to use WordPress as a headless CMS with Next.js. It leverages Advanced Custom Fields (ACF) to manage custom data in WordPress and fetches this data via the WPGraphQL plugin to render content on the Next.js frontend.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published