Hosting a WP site on Netlify

I’ve read that Netlify can host a WP site. Apparently, a WP plugin would be used to convert the site to Netlify compatibility. I also read that it wouldn’t be practical if the site requires frequent updating. With regard to updating, is it true that any updates could be done within Netlify and don’t have to be done in WP? If that’s true, it doesn’t seem like doing an update would difficult. Thanks.

Netlify is a static file hosting at it’s, so if the WP plugin is rendering static asstes (html, css, js), you can copy that to netlify. Once you do a change in the WP CMS, you have to run that WP plugin which will render the whole site again and it has to copy to files to Netlify. So the changes won’t be visible in that instant, because these steps needs to be repeated in each change.

There is a static site generator called Gatsby which can be used to output the static resources, but it has to connect to the WP instance. I think it has a WP connector plugin which can connect directly to the WP REST API and grab the content you have stored in the DB, but this part neeeds to be customized as not all WP DB has the same schema.
So in this scenario you will gonna need to run the WP Admin site and use the CMS side of it all the time and Gatsby is responsible to generate the static resources and deploy to Netlify.

If you want to get rid entirely from WP you have to substitute the CMS/Admin part with a CMS, that means, that whatever you have on WP’s DB you have to export in a flat file system or import it in a CMS server like Contentful.
Once you’r done with this, you have one part where you have the content and an engine which outputs content from the data to Netlify.
So the answer to your last question is no, you need to have a CMS where you can make the changes.
It’s doable but pending on your usecase you need to make the right choices.

Thanks. Summarising, unless you leave WP completely, you will have to continue to use WP to make changes to the site. You could not use the Netlify CMS for changes. After each change, the conversion process to Netlify would have to be repeated.

Based on that scenario, it’s best not to use Netlify unless you leave WP completely.

It’s still worth using Netlify in that scenario if you have:

  • A lot of traffic hitting your wordpress site
  • You’re getting hacked regularly or having a hard time maintaining WP
  • You want excellent page load speeds and SEO benefits
  • You’re ok if the changes you do are not instantly showed on to the site (delay could be 3secs-2mins)
  • For more benefits please check this link out

Thanks…

1 Like

The answer depends partially on your definition of what is practical. I have a 2,000-page WordPress site that I convert to a static site using SiteSucker for hosting on Netlify. HTTRACK and other site spiders/archivers should work, too. However, it requires that the entire site be uploaded each time there is a change, and there are one or two “touch-up” tasks that need to be performed each time (in BBEdit). It’s practical for me in this instance, but it would not be practical for some of my other WordPress sites that are ginormous. If this sounds interesting, you can check out the results at https://non-intervention.netlify.com

Thanks. Another possibility I’m looking into is a conversion from WP to Gatsby and then publish on Netlify.

If you’re looking into that there’s 2 different ways to go about it. There’s a Gatsby plug in for WordPress which uses the REST API of WP. Or there’s a WordPress GraphQL plugin for using just GraphQL queries to build you’re Gatsby site. And Gatsby already uses GraphQL queries to build it’s pages.

1 Like

Thanks. What are the advantages/disadvantages of the two methods you mention?

Sure well I guess the advantages of using the WordPress REST API is that it has been tested at large scales, and is officially supported by WP. And other extensions like WooCommerce also use the same REST API for them. The disadvantages of using the REST API are that it sends back a bunch of data every time you make a request. Meaning they can be slower and you have to find the data you’re looking for.
Advantages of WP GraphQL is that you only query the data you need, and GraphQL will worry about what is the most advantages way or efficant way to do that. And you only have to work with the data you asked for.
Disadvantages of WP GraphQL is that it’s not out of Beta yet, and is only at version 0.3.5 or so.

Hope this helps :smile:

Yes, thanks…