Gatsby: How to update data every time I post on Wordpress

Created on 25 Sep 2019  路  1Comment  路  Source: gatsbyjs/gatsby

Hello. Thanks for this great plugin.

The plugin works fine. It shows data from Wordpress.
But whenever I create or edit a post on Wordpress the changes don't update in Gatsby unless I rebuild it.

This is how it works? or am I doing something wrong?

question or discussion

Most helpful comment

Thank you for opening this!

This is how it works? or am I doing something wrong?

Yes, this is how it works :) You'll need to run gatsby build every time your data changes. You normally use Webhooks (e.g. https://de.wordpress.org/plugins/wp-webhooks/ for WordPress) to trigger builds on your CI/CD provider (e.g. Netlify or CircleCI) when data changes. This way you don't have to trigger builds yourself.

If you don't use any CI/CD provider and manually build the project locally on your machine, then yes, you'll have to rebuild and upload yourself.

We're marking this issue as answered and closing it for now but please feel free to reopen this and comment if you would like to continue this discussion. We hope we managed to help and thank you for using Gatsby!

>All comments

Thank you for opening this!

This is how it works? or am I doing something wrong?

Yes, this is how it works :) You'll need to run gatsby build every time your data changes. You normally use Webhooks (e.g. https://de.wordpress.org/plugins/wp-webhooks/ for WordPress) to trigger builds on your CI/CD provider (e.g. Netlify or CircleCI) when data changes. This way you don't have to trigger builds yourself.

If you don't use any CI/CD provider and manually build the project locally on your machine, then yes, you'll have to rebuild and upload yourself.

We're marking this issue as answered and closing it for now but please feel free to reopen this and comment if you would like to continue this discussion. We hope we managed to help and thank you for using Gatsby!

Was this page helpful?
0 / 5 - 0 ratings