Exclude tags from gatsby-source-wordpress-experimental

521 views Asked by At

when I build my Gatsby website using datas fetched with "gatsby-source-wordpress-experimental" plugin, then I can see during build that the plugin fetch tags: "success gatsby-source-wordpress Tag - 91.763s - fetched 502"

There's many tags and it costs a lot of time, but I don't need it / use it in my project.

I setup a Gatsby configuration in gatsby-config.js file like so to avoid fetching tags:

{
  resolve: "gatsby-source-wordpress-experimental",
  options: {
    url: "https://my.website.io/graphql",
    type: {
      Post: {
        limit: 100,
      },
    },
    excludedRoutes: ["**/tags", "**/taxonomies", "**/users"], // <= see here excluded routes
    includedRoutes: ["**/products"],
  },
},

But it still fetch tags. I think that I did that according to the docs but what I am doing wrong ?

Thanks !

1

There are 1 answers

2
Ferran Buireu On

According to the documentation you can pass an array to exclude the field names like:

{
  resolve: `gatsby-source-wordpress-experimental`,
    options: {
        excludeFieldNames: [`tag1`, `tag2`],
  },
},

Besides, excludedRoutes is a configuration only allowed in gatsby source-wordpress, not in the experimental version.