White Label Coders  /  Blog  /  To have the cake and eat it too – Headless WordPress

Category: WordPress

To have the cake and eat it too – Headless WordPress

Headless WordPress
17.07.2020
3 min read

So we did it – we have learned how to take all advantages of the most popular CMS with the benefits of static sites it offers. “Why to do so?” you may ask. The answer is simple: because static sites are safe, very fast (no backend code!), and generally easier to maintain. On the other hand, WordPress is great for its flexibility and popularity as far as the content creation is concerned.

MAGIC OF GATSBY

Gatsby is, in short, a static site generator. It uses React for building HTML templates, but the components are not rendered at runtime there – using Node.js process, Gatsby creates the templates ahead of time.

Still, the real “magic wand” in Gatsby is a GraphQL method used for data querying and retrieving. GraphQL is a query language for APIs. It was developed internally by Facebook, and in 2015 was publicly released.

CREATING A PROCESS

Having WordPress and Gatsby we could build a process: from creating content in WordPress, through intercepting the data by GraphQL, to placing them into Gatsby created templates. Furthermore, using GraphQl mutation, we can send the data back from a static site to WordPress. Making small change in the WordPress .htaccess file we can decide which sites would be dynamic ones, and which of them static ones, respectively.

Headless WordPress

HOSTING AND DEPLOYMENT

We don’t like to make our developer’s life too complicated. So, from the only beginning we decided that the WordPress installation, Gatsby files and all static files generated by Gatsby should be hosted on a single server. Furthermore, the user should get the possibility to create static sites after every change of content. We found a tool, the WordPress plugin, developed by a group of independent developers, which made all that possible. At that point, we actually had all we needed to implement our “Headless WordPress” into production.

TOOLS

You may say that the worldwide community of “WordPress-Gatsby Brotherhood” fans never sleeps. Many useful tools have already been developed, like WPGraphQl WordPress plugin for example.  We decided to use it, and then to take advantage of Gatsby Source GrapgQl plugin. React Apollo supports the process of sending the data back from a static site to WordPress. In short words – all necessary tools are there, available under the MIT license. The only difficulty is to learn how to use them all together.

CONCLUSION

For all websites which content doesn’t change very often, the “headless WordPress” is a great solution. Due to the necessary “building” process, it doesn’t make sense to use static sites for e-commerce or news portals – at least for now – we think. Nevertheless – who knows what tomorrow holds?

So, running an agency, should you consider offering headless wordpress websites to your clients as a standard?

Definitely yes. Even for a brochure-like website, this approach gives you blazing speed, which improves site SEO and overall user experience. It also increases site security. Since it does not generate significant overhead in terms of labour intensity – we’ll definitely recommend this approach to agencies we work with.

Why shouldn’t you use it as your competitive edge? While your client most likely won’t be interested in the technical stuff, should appreciate easy to prove, quantifiable improvement in site speed.

Paweł_Zmysłowski

CEO / Team Leader

Serial entrepreneur in the IT industry. Former coder, graduated from Silesian University of Technology. His strong technical background coming from the former programming career, combined with business analysis skills and real-life business development experience, based on an 18-years track record as an entrepreneur, blends into a mixture of competences extremely helpful on a leadership position he holds in WLC.

Related Articles
SEE OUR BLOG
Check related articles
Why are my affiliate landing pages loading slowly and hurting conversions
Why are my affiliate landing pages loading slowly and hurting conversions?

Slow-loading affiliate landing pages kill conversions before visitors even see your offers. The main culprits include oversized images, poor hosting, excessive plugins, and unoptimised databases that create bottlenecks. Website performance directly impacts your affiliate marketing success through bounce rates and conversion drops. Understanding these issues helps you identify solutions that boost both page speed and revenue. Heavy images, inadequate hosting, and bloated code are the primary reasons affiliate landing pages crawl instead of sprint. These technical issues compound to create frustrating user experiences that drive potential customers away before they engage with your content. Oversized images represent the biggest performance […]

Read more
How to build consistent affiliate page templates that convert
How to build consistent affiliate page templates that convert

Building affiliate page templates that actually convert isn’t just about making things look pretty. It’s about creating a system that consistently guides visitors toward taking action, whether that’s signing up for a casino account or claiming a bonus. When your templates work properly, they reduce bounce rates, increase conversions, and make your content team’s life much easier. The problem is that most affiliate sites end up with a patchwork of different page designs, inconsistent messaging, and confusing user experiences. This confusion costs you money every single day. You need a template system that works across all your pages, maintains consistency, […]

Read more
Can I build a website on WordPress and host it somewhere else
Can I build a website on WordPress and host it somewhere else?

Yes, you can absolutely build a WordPress website and host it elsewhere. WordPress is designed to be flexible, allowing you to develop your site using the WordPress content management system (CMS) and then host it on any compatible web hosting provider of your choice. This separation gives you greater control over your website's performance, cost, and technical specifications. The WordPress.org software is completely portable, meaning you can develop locally or on one host and move your website to another hosting environment whenever needed, without being locked into any specific hosting platform.

Read more
WordPress Development Workflow
The WordPress development workflow – the best practices

The purpose of this article is to describe how we work on Wordpress Development at White Label Coders, and provide an inspiration for everyone who currently is seeking for good practices to follow and setup his own way of working with WordPress site.

Read more
What is the best workflow for managing 500+ review pages
What is the best workflow for managing 500+ review pages?

Managing hundreds of review pages doesn't have to be chaos. The best workflow combines centralized data management with custom WordPress architecture, letting you update broker information once and see changes reflected across all pages instantly. This comprehensive guide reveals how successful affiliate platforms handle 500+ reviews efficiently—from custom Gutenberg blocks and automated API integrations to team workflows that prevent conflicts and maintain data accuracy. Discover the exact systems, tools, and processes that transform overwhelming content portfolios into manageable operations without proportionally increasing team size.

Read more
delighted programmer with glasses using computer
Let’s talk about your WordPress project!

Do you have an exciting strategic project coming up that you would like to talk about?

wp
woo
php
node
nest
js
angular-2