Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Latest commit

 

History

History
75 lines (49 loc) · 4.53 KB

getting-started.md

File metadata and controls

75 lines (49 loc) · 4.53 KB

This page has moved to the Gatsby monorepo!

Hi there! 👋 thank you so much for being a beta/alpha tester of this plugin! You've helped us bring a much more stable WordPress integration to Gatsby and we're very thankful for that!

We've shipped this plugin as gatsby-source-wordpress@4.0.0. gatsby-source-wordpress-experimental is now deprecated. Please upgrade by npm/yarn installing the latest version of the stable plugin and updating your gatsby-config.js to include the stable plugin name.

We've chosen this point to release this plugin as a stable release not because there are no bugs (all software has some bugs), but because this plugin is far more stable than the last major version of gatsby-source-wordpress.

Note that we will continue fixing Github issues you've opened in the -experimental repo - those are not forgotten and will be transferred to the Gatsby monorepo.

Thank you! 💜

Installation & Getting Started 🐤

If you've had previous experience with Gatsby or you like to move fast, you can use the quick start steps below to get up and running quickly. If you'd like to take a step back and learn more first, head over to our tutorials 👣

Quick start

  1. Install Node, Gatsby, and gatsby-cli

  2. Install a starter gatsby new my-wordpress-gatsby-site https://github.com/gatsbyjs/gatsby-starter-wordpress-blog

  3. Install and activate both of the following plugins in a live WordPress instance.

  4. In the gatsby-config.js of the starter you just set up, update the plugin options for gatsby-source-wordpress-experimental. Change the url option so that it points to your WordPress instance GraphQL url. This should be the full url of your GraphQL endpoint. Eg https://yoursite.com/graphql

  5. Run gatsby develop and experience the magic 🌟

  6. Create your beautiful and accessible app 💅

  7. Build with Gatsby Cloud & deploy to Netlify for a fast, wonderful, and affordable CI/CD experience 💥 🚀

Hot tip

For a fast, easy, and reliable WordPress local dev server, use Local by Flywheel. This will save you time setting up WordPress on your computer and you can easily push and pull to and from Flywheel/WPEngine hosting!

Required WordPress Dependencies

In addition to WordPress, there are 2 other required plugins on the PHP side of things. If you're on the latest version of the source plugin and these plugins, everything will work great. If there is a version mismatch, you'll be notified and provided a download link for the correct versions in your terminal via our compatibility API when you run a build 😄

WPGraphQL

This plugin turns your WordPress instance into a GraphQL server.

WPGatsby

This plugin modifies the WPGraphQL schema in Gatsby-specific ways and also keeps a record of when user actions happened. This allows us to do selective cache invalidation in Gatsby (to speed up builds) and add Preview support.

WordPress

Please note that we only officially support the latest version of WordPress. However, WordPress is great at keeping backwards compatibility and older versions may work.

Up Next 👉