We are using Gatsby framework and fetching content from WordPress. However, the Gatsby Cloud previews are not consistent and are sometimes redirecting to other pages. Is there any configuration we need to implement in WordPress to fix this issue? We have tried running previews on local preview server, changing settings in WordPress and enabling debug for previews, but the redirect from the WordPress URL to the Gatsby source WordPress post/page URL is still not working properly. Can anyone provide guidance or insights on how to resolve this issue?
Below are the mentioned versions.
Version | |
---|---|
gatsby | 5.4.2 |
gatsby-source-wordpress | 7.3.2 |
WordPress | 6.1.1 |
WP Gatsby | 2.3.3 |
WP GraphQL | 1.13.7 |
As per the gatsby-source-wordpress troubleshooting doc we even tried running previews on local preview server.
In WP, settings/gatsbyjs we then changed the setting as below: Preview Webhook URL : https://mypreviewdomain.com/__refresh Gatsby Content Sync URL : https://mypreviewdomain.com/
We enabled the debug for previews and can see the logs of the post/page data when we click preview in WP. The preview URL gets redirected from the WP URL to https://mypreviewdomain.com/gatsby-source-wordpress/postid-date/postid (e.g. https://mypreviewdomain.com/gatsby-source-wordpress/122412023-01-27%2011:01:31/12241/) and it shows 404 page. However, if we browse the post URL directly (https://mypreviewdomain.com/post-url), we can see the updated content. This means that the preview changes are working properly but the redirection to the respective post/page URL is having some issue.