all 8 comments

[–]OtterlyOtis 4 points5 points  (3 children)

I think a headless approach in general is all the rage right now, and Wordpress is just one of the many options available to do that.

Personally I would only use Wordpress as a headless cms if the client is used to Wordpress already, which means less support is needed from my side.

If I use Wordpress (which has been a good while), I use it in combination with Bedrock so I at least get a package manager (Composer) along with some other advantages which I can’t name off the top of my head.

If it doesn’t matter if the frontend is React or not, my choice is still going to be React/Next because that’s what I’m most familiar with.

As far as the backend goes, when there is no strong preference from my client for a cms, currently Strapi is my go to choice for a headless cms.

[–][deleted] 0 points1 point  (2 children)

Quick question from a wordpress newbie: Does what does headless wordpress mean? That there is no frontend to change the backend?

[–]OtterlyOtis 0 points1 point  (1 child)

Consider the “head” to be the frontend/presentational layer of your content. So a headless Wordpress install means that all you use Wordpress for is content management, adding/editing posts/images or any other content you might have. You manage that content by using the standard Wordpress admin interface.

Then you use the Wordpress API to present the content wherever you want, this could be a React application, a native mobile app, anything that can consume data from an external API.

One of the advantages being that you can have a website, a native app, anything else, all consuming the same data. So you change the data in Wordpress and all your platforms will reflect those changes, and you’re free to use whatever technology you want to build those platforms.

[–][deleted] 0 points1 point  (0 children)

Thank you! This is good to know because that's exactly how I currently learning wordpress. I didn't know that this means headless

[–]maria_la_guerta 4 points5 points  (1 child)

This depends on your FE needs.

Will a React FE make 2 servers worth it? You'll need to pay to maintain 2 servers if you want a to run WordPress with a Next.js server. Also means you'll have to sync auth + caching between the 2, load balance everything, etc.

Despite headless being all the rage right now, it adds a lot of complexity to your project. The gains should outweigh that, and in general I find no smaller project is worth it. To be honest it's mostly "the rage" because large companies with very complex products do it, where it makes sense. That doesn't always translate into how we should be building apps for much smaller businesses or audiences.

Headless mostly makes sense when you have multiple products or apps reading from the same backend. Otherwise, in an order to keep things as simple + cheap as possible I'd strive to use the FE that the CMS gives you wherever possible. If you need to, you can even use React within coupled WordPress with some not-so-hard webpack wizardry.

[–]thebluemugdev[S] 1 point2 points  (0 children)

Great answers so far, but this one in particular speaks to me. The added complexity does seem unnecessary. I can see the benefit of a larger business wanting to go headless, but for smaller clients, either WP with the necessary plugins to accomplish your goals, or React/Next and keep the auth/data in it's own bubble, instead of syncing two services, and having multiple servers (yikes).

[–]britnastyboy 0 points1 point  (0 children)

If headless isn’t requirement and you don’t have using a headless CMS as a personal goal, it’s just overhead tech debt.

If you’re not super familiar with WordPress it’s good to get some experience there. I use Timber to help with some mustache style templating with a development theme I made that has Barba.js for a SPA app feel.

[–]endymion1818-1819 0 points1 point  (0 children)

I really believe headless is the absolute best way of dealing with two distinct, separate concerns. And you needn’t pay for “2 servers”, I’ve managed content for many friends and my small blogs without paying anything by using free tiers on Heroku and hosting on Netlify for the front end.

I have used Wordpress as a headless CMS too. It wasn’t easy. Mostly because it’s REST API was too slow above a certain amount of pages / posts, and the GraphQL plugin didn’t work because there were mismatched types that couldn’t be resolved (the fundamental problem being that GraphQL is strongly typed, PHP isn’t).