title: gatsby-source-wordpress plugin: I cant pull data from WP into Gatsby (error with connection)
body: <p>I am testing how Gatsby and WP work together and I checked the example coming from the official plugin documentation (<a href="https://github.com/gatsbyjs/gatsby/tree/master/examples/using-wordpress" rel="nofollow noreferrer">Wordpress example on Github</a>)</p>
  <p>I am hosting locally using <strong>MAMP</strong> with ports set on <strong>80 &amp; 3306</strong>.</p>
  <p>I know the error is in my gatsby-config.js on the <strong>baseUrl</strong>, because I tried to change it to a dummy website (live) and the issue was solved. So I guess something goes wrong when trying to get WP data from localhost. Here is my gasby-config.js file:</p>
  <pre><code>module.exports = {
    siteMetadata: {
      title: `Gatsby Default Starter`,
      description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
      author: `@gatsbyjs`,
    },
    plugins: [
      `gatsby-plugin-react-helmet`,
      {
        resolve: `gatsby-source-filesystem`,
        options: {
          name: `images`,
          path: `${__dirname}/src/images`,
        },
      },
      `gatsby-transformer-sharp`,
      `gatsby-plugin-sharp`,
      {
        resolve: `gatsby-plugin-manifest`,
        options: {
          name: `gatsby-starter-default`,
          short_name: `starter`,
          start_url: `/`,
          background_color: `#663399`,
          theme_color: `#663399`,
          display: `minimal-ui`,
          icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
        },
      },
      {
        resolve: `gatsby-source-wordpress`,
        options: {
          /*
            * The base URL of the WordPress site without the trailingslash and the protocol. This is required.
            * Example : 'dev-gatbsyjswp.pantheonsite.io' or 'www.example-site.com'
            */
          baseUrl: `localhost`,
          protocol: `https`,
          hostingWPCOM: false,
          useACF: false,
          searchAndReplaceContentUrls: {
            sourceUrl: &quot;http://localhost&quot;,
            replacementUrl: &quot;https://localhost:8000&quot;,
           },  
        },
      },
      // this (optional) plugin enables Progressive Web App + Offline functionality
      // To learn more, visit: https://gatsby.dev/offline
      // `gatsby-plugin-offline`,
    ],
  }
  </code></pre>
  <p>This is the error I get in terminal:
  <a href="https://i.stack.imgur.com/gY2k1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gY2k1.jpg" alt="error" /></a></p>
  <p><strong>What I have tried</strong>:</p>
  <ul>
  <li>Changed ports on MAMP to default (Apache: 8888, Nginx: 7888, MySQL: 8889) but than I can't open m WP site at all (I get a server error when typing localhost:8888 in search bar)</li>
  <li>Change baseUrl to a dummy live website: issue was than solved, but I need it to work on localhost</li>
  <li>Change the protocol to http (instead of https) because I read a similar thread here on Stack, but I still get the same error</li>
  <li>Migrating my WP site to temporary domain with Flywheel and using that baseUrl instead (which became testSite123.flywheelsites.com) but again, same error.</li>
  </ul>
  <p>I feel a bit out of options, any idea is welcomed!</p>