This is not really a Netlify question. You’d have better luck getting help by asking on Gatsby or Wordpress forums or on other coding forums like Stackoverflow.
Hi, I was recently looking for this functionality and couldn’t find anything. I ended up coming across a find/replace packages for HTML nodes. Put an article together on how this can be used to handle WordPress shortcodes in Gatsby.