{"componentChunkName":"component---src-templates-blog-post-js","path":"/headless-wordpress-explained-and-why-you-need-it/","result":{"data":{"markdownRemark":{"id":"a4ba7f44-9168-563b-b2de-37b938049f51","html":"<p>The chances are, I don’t need to tell you about the benefits of using WordPress as the content management system for your website.</p>\n<p>It’s straightforward, familiar and easy to use.</p>\n<p>With web technologies advancing quickly as ever, there’s a new way to use WordPress that you should be considering.</p>\n<p>You may have heard of the following phrases:</p>\n<ul>\n<li>Headless WordPress</li>\n<li>Decoupled WordPress</li>\n</ul>\n<p>These are similar terms for pretty much the same thing.</p>\n<p>Headless or decoupled, the strategy is to detach the WordPress <a href=\"https://en.wikipedia.org/wiki/Front_and_back_ends\">back end</a> from the <a href=\"https://en.wikipedia.org/wiki/Front-end_web_development\">front end</a>.</p>\n<p>Bringing with it the best of both worlds for those that want to serve a modern front end and manage their content within WordPress.</p>\n<p>In this article, I’ll explain what headless WordPress is and why you might want to use it for your next project.</p>\n<h2 id=\"what-is-a-headless-content-management-system\" style=\"position:relative;\"><a href=\"#what-is-a-headless-content-management-system\" aria-label=\"what is a headless content management system permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What Is A Headless Content Management System?</h2>\n<p>Before we look at headless WordPress specifically, we need to think about headless CMS methodology in general.</p>\n<p>A headless architecture approach makes no assumptions about the presentation layer. In other words, the back end does not care about the front end.</p>\n<p>The CMS is built to create content, store content and serve it as an API.</p>\n<p>The <a href=\"https://en.wikipedia.org/wiki/Application_programming_interface\">API</a> (Application Programming Interface) acts as the bridge between the two pieces of software (back end and front end), allowing them to communicate.</p>\n<p>This allows a PHP back end to interact with a JavaScript front end, for example. This being the typical reason you’d want to consider a headless approach.</p>\n<p>A separation of concerns between the back end and front end of your web project can be beneficial because:</p>\n<ol>\n<li>You can change one without having to change the other, leaving each to evolve at their own pace. This can lead to faster development overall.</li>\n<li>It’s possible to appropriately source and place-specific expertise within your development team.</li>\n<li>Separating your codebase into two repositories makes it easier to implement tests, deployment pipelines and to revert changes should something go wrong.</li>\n</ol>\n<p>In summary, a headless content management system has the following traits:</p>\n<ul>\n<li>It stores content in a database.</li>\n<li>Creation of said content is done in a back end admin area.</li>\n<li>This content can be served to any given front end and/or device via an API.</li>\n</ul>\n<h2 id=\"so-how-does-headless-wordpress-work\" style=\"position:relative;\"><a href=\"#so-how-does-headless-wordpress-work\" aria-label=\"so how does headless wordpress work permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>So How Does Headless WordPress Work?</h2>\n<p>Relating this approach to WordPress; the overall premise of a headless WordPress project is to utilise the <a href=\"https://developer.wordpress.org/rest-api/\">REST API</a>.</p>\n<p>The REST API was introduced to WordPress core in December 2015 as a way to extend the classic usage of the CMS.</p>\n<p>It allows external websites and applications to interact with the CMS remotely via <a href=\"https://en.wikipedia.org/wiki/JSON\">JSON</a> objects.</p>\n<p>WordPress core includes endpoints of data for much of the default data sets. For instance, posts and pages.</p>\n<p>You can further customise the API depending on your projects’ requirements.</p>\n<p>Technically, this can be done using existing plugins or by creating a custom plugin.</p>\n<p>A purpose-built headless WordPress plugin could bring the following to your API:</p>\n<ul>\n<li>Custom post type data.</li>\n<li>Custom taxonomy data.</li>\n<li>Custom field/meta data within your post objects.</li>\n<li>Bespoke object structures for each post type.</li>\n<li>Firing of other WordPress functions upon requests to your API.</li>\n<li>Third-party service integrations.</li>\n</ul>\n<p>From a development point of view, the REST API allows you to use WordPress in a more modern, resilient, scalable, secure and performant way.</p>\n<p>From a content editor’s perspective, the REST API is a gateway to the content you have in your WordPress admin panel.</p>\n<p>It allows your data to be consumed by any type of (and number of) channel(s).</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 760px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/b54c394e6657edaab2c904033ba11159/39630/headless-wordpress-diagram.jpg\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 80.0956937799043%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAQABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAECBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAd+WiyQ//8QAFhAAAwAAAAAAAAAAAAAAAAAAAAEg/9oACAEBAAEFAhT/AP/EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABQQAQAAAAAAAAAAAAAAAAAAACD/2gAIAQEABj8CX//EABgQAAMBAQAAAAAAAAAAAAAAAAABcRAR/9oACAEBAAE/IddonRM//9oADAMBAAIAAwAAABDAz//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EABoQAQADAAMAAAAAAAAAAAAAAAEAETEQcYH/2gAIAQEAAT8QcZp33hupQlFvaWmM/9k='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"A typical Headless WordPress architecture diagram\"\n        title=\"A typical Headless WordPress architecture diagram\"\n        src=\"/static/b54c394e6657edaab2c904033ba11159/31642/headless-wordpress-diagram.jpg\"\n        srcset=\"/static/b54c394e6657edaab2c904033ba11159/d053c/headless-wordpress-diagram.jpg 190w,\n/static/b54c394e6657edaab2c904033ba11159/622bd/headless-wordpress-diagram.jpg 380w,\n/static/b54c394e6657edaab2c904033ba11159/31642/headless-wordpress-diagram.jpg 760w,\n/static/b54c394e6657edaab2c904033ba11159/39630/headless-wordpress-diagram.jpg 1045w\"\n        sizes=\"(max-width: 760px) 100vw, 760px\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<h2 id=\"what-front-end-frameworks-can-be-used-with-headless-wordpress\" style=\"position:relative;\"><a href=\"#what-front-end-frameworks-can-be-used-with-headless-wordpress\" aria-label=\"what front end frameworks can be used with headless wordpress permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What Front End Frameworks Can Be Used With Headless WordPress?</h2>\n<p>You can use a headless WordPress back end with any number of front ends strategies.</p>\n<p>Commonly, this would be JavaScript based. So frameworks like:</p>\n<ul>\n<li><a href=\"https://reactjs.org/\">React</a></li>\n<li><a href=\"https://facebook.github.io/react-native/\">React Native</a> (for native mobile apps)</li>\n<li><a href=\"https://preactjs.com/\">Preact</a></li>\n<li><a href=\"https://vuejs.org/\">Vue.js</a></li>\n<li><a href=\"https://angularjs.org/\">Angular</a></li>\n</ul>\n<p>Or static site generators like:</p>\n<ul>\n<li><a href=\"https://www.gatsbyjs.org/\">Gatsby</a> (with GraphQL)</li>\n<li><a href=\"https://nextjs.org/\">Next.js</a></li>\n</ul>\n<p>These are all viable presentation layer options for a headless WordPress website.</p>\n<p>If you’re not sold on one of the popular JavaScript frameworks, you could go even simpler:</p>\n<ul>\n<li>Bring in your data from WordPress with <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch\">vanilla JavaScript fetch</a>.</li>\n<li>Display this data with HTML markup.</li>\n<li>Style with CSS.</li>\n</ul>\n<h2 id=\"why-do-i-need-headless-wordpress\" style=\"position:relative;\"><a href=\"#why-do-i-need-headless-wordpress\" aria-label=\"why do i need headless wordpress permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why Do I Need Headless WordPress?</h2>\n<p>There are many benefits to going headless WordPress for businesses, developers, website owners and end-users.</p>\n<p>These include:</p>\n<h3 id=\"separation-of-concerns\" style=\"position:relative;\"><a href=\"#separation-of-concerns\" aria-label=\"separation of concerns permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Separation Of Concerns</h3>\n<p>As touched on earlier in this article, it can be a good idea to separate the back and front ends of your web project.</p>\n<p>This carries forward specifically into WordPress.</p>\n<p>Having your WordPress back end on one server, optimised for server-side tasks and your front end hosted on a separate CDN can help to secure your website and increase performance.</p>\n<p>Two important areas of interest for all web projects.</p>\n<h3 id=\"security\" style=\"position:relative;\"><a href=\"#security\" aria-label=\"security permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Security</h3>\n<p>Due to the sheer amount of WordPress websites on the web, they are often targeted by hackers.</p>\n<p>Using headless WordPress increases security two-fold.</p>\n<p>Firstly, you won’t be using many (if any) public plugins. Or a theme. This is where most vulnerabilities in WordPress websites usually arise.</p>\n<p>Secondly (and perhaps most importantly), because you’re using WordPress in a decoupled fashion, hosted separately away from your public-facing front end, it’s difficult to tell that you’re using WordPress at all.</p>\n<p>Many attacks are initiated by automated bots. These bots scan thousands of websites to determine the type of software they’re using.</p>\n<p>If it’s tricky to tell that your site is running WordPress, it’s much harder to exploit it in that fashion.</p>\n<h3 id=\"performance\" style=\"position:relative;\"><a href=\"#performance\" aria-label=\"performance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Performance</h3>\n<p>It can be a difficult task to make a traditional WordPress website fast.</p>\n<p>A bloated premium theme and lots of plugins mean this is going to be a struggle.</p>\n<p>When using WordPress headless with a statically generated front end, performance comes with the territory.</p>\n<p>The Google PageSpeed Insights tool tests your site against many parameters, including:</p>\n<ul>\n<li>First contentful paint</li>\n<li>First meaningful paint</li>\n<li>Speed index</li>\n<li>First CPU idle</li>\n<li>Time to interactive</li>\n<li>Max potential first input delay</li>\n</ul>\n<p>Most sites using the headless approach will score well here.</p>\n<p>Using my own website as an example. With WordPress for blog post management and Gatsby on the front end, my pages load super fast. Typically under a second.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 760px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/5366c827a1167a0b59a0edce2ee76279/33529/tomhirst-pagespeed-score.jpg\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 77.68762677484786%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAQABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAIDBf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHvMySof//EABkQAAIDAQAAAAAAAAAAAAAAAAABAgMSMf/aAAgBAQABBQJnEr62biaixVQR/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGRAAAgMBAAAAAAAAAAAAAAAAAAECESEx/9oACAEBAAY/AjTJHUVaMgj/xAAcEAACAgIDAAAAAAAAAAAAAAAAAREhMVFhgcH/2gAIAQEAAT8hsqJswQjlLFH7nPVRswR6P//aAAwDAQACAAMAAAAQBD//xAAVEQEBAAAAAAAAAAAAAAAAAAAAIf/aAAgBAwEBPxBX/8QAFREBAQAAAAAAAAAAAAAAAAAAACH/2gAIAQIBAT8QR//EABkQAQEBAQEBAAAAAAAAAAAAAAERACHRYf/aAAgBAQABPxCpqXJVIFX4ZgGGMHzeVMdBa4I9cmHQJbA7/9k='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"tomhirst.com 100 page speed score\"\n        title=\"tomhirst.com 100 page speed score\"\n        src=\"/static/5366c827a1167a0b59a0edce2ee76279/31642/tomhirst-pagespeed-score.jpg\"\n        srcset=\"/static/5366c827a1167a0b59a0edce2ee76279/d053c/tomhirst-pagespeed-score.jpg 190w,\n/static/5366c827a1167a0b59a0edce2ee76279/622bd/tomhirst-pagespeed-score.jpg 380w,\n/static/5366c827a1167a0b59a0edce2ee76279/31642/tomhirst-pagespeed-score.jpg 760w,\n/static/5366c827a1167a0b59a0edce2ee76279/33529/tomhirst-pagespeed-score.jpg 986w\"\n        sizes=\"(max-width: 760px) 100vw, 760px\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p>Using this methodology can also bring your website into the PWA (Progressive Web App) bracket.</p>\n<p>The reason being, it’s possible to add features like making your website installable for viewing offline or when your connection is slow.</p>\n<p>Performance is a key metric of a websites’ success.</p>\n<p>Google uses page speed as a ranking factor for both <a href=\"https://webmasters.googleblog.com/2010/04/using-site-speed-in-web-search-ranking.html\">desktop</a> and <a href=\"https://webmasters.googleblog.com/2018/01/using-page-speed-in-mobile-search.html\">mobile searches</a>.</p>\n<p>And, people expect your site to be fast. On all devices.</p>\n<p>If your users can’t look something up quickly or go through a checkout process in a reasonable time, they’ll often abandon their efforts.</p>\n<p>A <a href=\"https://www.thinkwithgoogle.com/marketing-resources/data-measurement/mobile-page-speed-new-industry-benchmarks/\">Google study</a> discovered that 53% of mobile site visitors leave a page that takes longer than three seconds to load.</p>\n<p>In business terms, this could mean missed leads and sales. Directly due to lacking performance.</p>\n<p>Making your website fast benefits everyone.</p>\n<h3 id=\"scalability\" style=\"position:relative;\"><a href=\"#scalability\" aria-label=\"scalability permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Scalability</h3>\n<p>Lots of enterprise-scale projects are moving towards headless architecture because of its scalability.</p>\n<p>Headless WordPress can help your website scale easier than is standard.</p>\n<p>As your back end and front end is separated you can scale each in order of priority as you grow. This can be beneficial if you’re looking for a quick time to market.</p>\n<p>For example, you might want to create an app in the future. But right this minute, your focus is to get your website live.</p>\n<p>In this instance, headless WordPress would be a good choice because you can create a REST API that first serves data to your website, and then to your app when the time comes.</p>\n<p>Due to the statelessness of the REST API, cloud scalability also comes into play.</p>\n<p>This is an advantage because if your site goes viral all of a sudden, with many users at once, your CDN can compensate.</p>\n<h3 id=\"modern-build-tools-and-processes\" style=\"position:relative;\"><a href=\"#modern-build-tools-and-processes\" aria-label=\"modern build tools and processes permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Modern Build Tools And Processes</h3>\n<p>Having a headless WordPress website means you can utilise the most modern web development technologies.</p>\n<p>Using WordPress headlessly brings it into <a href=\"https://jamstack.wtf/\">JAMstack</a> territory.</p>\n<p>JAM (JavaScript, API and Markup) stack is “a modern web development architecture based on client-side JavaScript, reusable APIs, and prebuilt Markup”.</p>\n<p>Many see this methodology as the future of web development due to its <a href=\"https://jamstack.wtf/#benefits\">associated advantages</a>.</p>\n<p>Headless WordPress inherits these benefits. It also encourages the use of modern tools and processes for things like:</p>\n<ul>\n<li>Version control.</li>\n<li>Automated testing.</li>\n<li>Code formatting/linting.</li>\n<li>CDN (content delivery network) usage.</li>\n<li>Deployment/continuous integration.</li>\n</ul>\n<h3 id=\"multichannel-publishing\" style=\"position:relative;\"><a href=\"#multichannel-publishing\" aria-label=\"multichannel publishing permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Multichannel Publishing</h3>\n<p>Imagine publishing a piece of content once and having it go live across all your websites and apps at once.</p>\n<p>Headless WordPress can make this possible.</p>\n<p>This is especially valuable to organisations that have a lot of quickly updating data. Like news agencies.</p>\n<p>A headless WordPress install could be the data source for just about anything.</p>\n<p>To illustrate, you could create an <a href=\"https://www.amazon.co.uk/b?ie=UTF8&#x26;node=11242734031\">Amazon Alexa skill</a> that reads out data from your API.</p>\n<p>Or, you might want to push updates out to someone else’s website.</p>\n<p>Multichannel publishing saves you time and improves content consistency across your network.</p>\n<h3 id=\"get-ahead-of-your-competition\" style=\"position:relative;\"><a href=\"#get-ahead-of-your-competition\" aria-label=\"get ahead of your competition permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Get Ahead Of Your Competition</h3>\n<p>To finish up on the topic of why you need headless WordPress:</p>\n<p>You’ll get ahead of the game against your competition.</p>\n<p>Without being tied to monolithic architecture, you can use headless WordPress to increase your sites security, performance and scalability to move past your peers.</p>\n<p>Making use of this modern approach will help you stand out in the marketplace.</p>\n<p>All the aforementioned advantages of using headless WordPress can result in a direct boost to your business objectives.</p>\n<h2 id=\"is-headless-wordpress-the-right-approach-for-my-project\" style=\"position:relative;\"><a href=\"#is-headless-wordpress-the-right-approach-for-my-project\" aria-label=\"is headless wordpress the right approach for my project permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Is Headless WordPress The Right Approach For My Project?</h2>\n<p>Are you set on using WordPress as your CMS?</p>\n<p>Are you looking to use a modern front end framework like React or a static site generator like Gatsby?</p>\n<p>If so, it’s the perfect avenue to explore.</p>\n<p>Are you looking to add lots of functionality via readily available plugins?</p>\n<p>Then you could be met with a few stumbling blocks.</p>\n<p>If you’re unsure about this decision, you could hire a <a href=\"https://www.tomhirst.com/headless-wordpress-developer/\">headless WordPress specialist</a> to discuss your specific requirements in detail.</p>\n<h2 id=\"wrap-up\" style=\"position:relative;\"><a href=\"#wrap-up\" aria-label=\"wrap up permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Wrap Up</h2>\n<p>Choosing an architecture and methodology for your WordPress project is important to get right from the off.</p>\n<p>With massive performance benefits, in particular, you should definitely consider headless WordPress for your next project.</p>\n<p>I firmly believe that headless has a big part to play in the future of WordPress for everyone.</p>","excerpt":"The chances are, I don’t need to tell you about the benefits of using WordPress as the content management system for your website. It’s straightforward…","frontmatter":{"title":"Headless WordPress Explained And Why You Need It","date":"13th September 2019","featured_image":{"childImageSharp":{"fluid":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAMEBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAdxT5SsA/8QAGhAAAwADAQAAAAAAAAAAAAAAAAECERIhMf/aAAgBAQABBQKvIp5H00cs/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGRAAAgMBAAAAAAAAAAAAAAAAARAAISJR/9oACAEBAAY/AuSyxpf/xAAZEAEAAwEBAAAAAAAAAAAAAAABABEhEHH/2gAIAQEAAT8haYbOXGZPDgpUUFl5/9oADAMBAAIAAwAAABCDz//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EAB0QAQACAgIDAAAAAAAAAAAAAAERIQBhMcEQQVH/2gAIAQEAAT8QiJoAvW8gcREGW5uZ4jvwaup4fm8nZUApZd3vrJz/2Q==","tracedSVG":"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='400'%20height='267'%3e%3cpath%20d='M187%2025l4%204%203%201h-3l-4-2-1-1c0%202-1%202-3%202-2-1-3%200-4%202-2%202-2%205%200%205s2%201%202%203c0%204%202%205%2011%207%207%200%209%200%208-4%200-2%200-2%202-3%205-2%203-8-2-9-2-1-3-1-2-3%200-2%200-2-2-2l-6-1-3%201m46%208c-6%203-7%204-4%205%206%200%2010%203%2011%208%200%204%201%204%202%202%204-4%205-12%202-16-3-3-5-3-11%201m17%205c0%204-2%2010-6%2014l-4%206-2%205-1-5c1-6%201-6-4%201-3%204-4%208-5%2012-1%207-2%207-4%200%200-2-3-5-5-7l-3-2c1%203-2%205-4%204h-22l-4-1c-2%200-3%200-2-2%201-3-3%201-9%2010-6%208-11%2012-11%208h-1l-1-10V58c-1-2-1-2-2%200l-1%202%201-14c1-5%200-7-1-8-3-2-3-1-2%202%202%203%202%204-3%204-2%200-3-1-5-3s-3-3-4-2h-1l-3%202c-1%201-2%202-5%202s-3%200-2%202l3%2012c-1-1-2%200-2%204l-3%205-6%208-6%207c-1-1-3%205-2%208%200%202-2%205-5%205l-1%201-1%203c-5%203%204%2011%2013%2011%208%201%2010-1%208-5-2-3-1-6%203-14l6-13c4-9%203-8%2011-6l1%201%203%208%201%202%201%202h1l1%202%203%205%206%207c3%202%203%203%202%204-2%201-1%204%201%205l6%203c3%202%205%202%2013%202%2011%200%2013-1%2018-6l3-3%204-3%204-3%201-2c1-1%201%200%201%202l-1%203c-2-1-3%205-1%206l1%203c1%203%208%209%2010%208l4-1c5-1%205-2%200-7l-2-5-1-1%205-2c5-1%206-1%205-2%200-1%200-4%203-8%203-8%204-10%205-18%200-6%201-7%204-10%206-7%205-19-2-26-2-1-2-1-2%201m-55%2031c-4%202-5%206-8%2018-2%209-2%209%200%209%204%201%209%200%2010-1%201-3%204-2%207%200%201%202%202%202%205%202%203-1%204-1%203%201l1%201c2-1%203-17%201-22-2-8-11-11-19-8m2%204c-4%205-2%2013%205%2013%202%200%207-4%207-7%200-7-7-10-12-6m-30%2053l5%203c4%202%205%204%206%208%201%202%200%202-1%202l-3%201-2%201-2%201%201%201%201%201c-1%202%201%207%203%207l5-1c4%200%204%200%203-2l-1-4c0-2%202-3%204%200v3c-1%203%200%205%204%206l3%203c0%203%201%203%204%203l4%202c2%205%204%205%208%201l5-4%204-2%204-3-1-1c-2-2-3-2-3%200%201%201%200%201-2%201-1%200-2%200-1%201%202%201-3%203-5%202-2%200-2%200-1%201%200%202-1%202-3%201v-4l2-12%202-11c2-4%200-3-3%201l-3%204-1%201-1%201h-3l-3-2-4-3-6-3-2-2h-3c-2%200-2%200-1-1s1-1-1-1c-4-1-4-1-3%201h-2v2l-4-3c-3-2-3-2-3%200m115%200l-2%201%201%201%201%203-3-1c-1-2-1-2-1%200%200%203-3%206-6%206-1-1-2-1-3%201l-1%203-1%205c0%204%200%204%202%204%205%200%208%200%2011-3%203-2%204-5%201-7l-1-3-1-1v-1l2%201%202%201%202-1%204-2c4-2%204-3%201-3h-1l-1%201h-1l-1%201h-1l-1%201v-4l-1-5-1%202m-172%204c-2%204-6%2033-3%2033l10-10%201-5c-2%201-3-3-1-5h1l1%202c1-1-2-12-3-11-1%200-2-1-2-3l-2-3-2%202m49%204c-2%201-1%2010%201%2011%201%201%201%201-1%201l-2%202h-1c-1-2-1-2-1%200s0%202-1%200l-2-2c-2%200-2%204%200%2010v2l3-2%205-2%201-2%202-5%203-5c0-3-6-9-7-8m85%207c0%206-1%209-2%206v2c0%203%200%203-1%201-2-3-6-3-8%200-1%203-1%203%201%203l-4%202h-6l10%201c19%202%2028%202%2029%200v-3c1%200%202%200%201-1l1-1c1%201%201%200%201-2s0-2-1%200l-1%201c0-1-1-1-1%201l-1%202v-4l-1%202c-1%201-1%201-1-1s0-2-1-1-1%201-1-1c1-2%200-5-1-7l-1-3h-11c-1-1-1%200-1%203m-108%204c-3%203-3%204-3%208l-1%202-2%201-5%203-5%203h-9v3l2%201-2%201c-2%200-2%200-1%201%202%202%202%202%201%203-1%202%200%204%202%204l5-3c5-4%205-4%207%200l2%204%204%201c3%203%2010%201%2010-3%201-1%200-2-1-2l-1%202-1%201-8-2-1-2-1-5v-3l1%203c1%205%203%206%204%204v-2l-1-8%202%201h3l1-2v-7c2-2%203-8%202-10l-4%203m100%2017l-1%201-1%201-1%201c-3-1-4%202-3%205%202%202%202%202%201%203l-2%208%205-4c4-4%208-6%205-2-3%202-3%207-2%2010%201%202%201%203-1%205l-7%209-5%206v1c0%202-2%205-4%205l-1-1%201-1%201-1%201-3%202-5c0-2%200-2-2-1l-2%201-1%201v1l-7-7-1-1-1-2-1-3v-1l-1-2c-1%200-2-1-1-3%200-2%200-2-1%200-1%201-1%201-1-1%200-3-2-4-2%200%200%205%200%206%203%2013l3%208%202%206v17l-6-2-7-2c-3-3-5-3-5%200l-8%207h-12l5-1c6-1%2011-4%2012-7l2-2v-1l-5%202c-6%205-18%204-26-1-6-4-7-3-5%201s2%205%201%206l-1%204c0%204%200%204-2%203l-2-1-1-2c-2-2-4-1-2%202%204%207%2038%208%2049%202%206-4%2017-3%2021%202l3%202%203%202%204%202%204%202c0%202%209%205%2019%206l17%203c9%202%2014%202%2026%200%2013-2%2015-3%2011-7-1-1-2-2-1-3l-9%203c-7%204-17%205-24%203l-9-3c-2%200-3%200-2-1h-1l-2-1-2-1-8-4-10-6c-4-1-4-2-4-4l-1-2c-1%200-1-9%202-23%202-16%203-10%200%209v8c1%202%203-14%203-23s0-9%209-9h5l2%207c2%2013%205%2017%2016%2021%207%202%2023%204%2028%203%207-2%2012-13%209-21-1-3-8-8-11-8l-3-3c0-3-3-5-7-5-3%200-2%200%202%201%202%201%203%202%203%204s-1%203-2%201l-3-1-2%201%201%201%201%201-2%201-4-1c-3-1-8-5-8-7%200-1%201-2%203-2%203-1%203-1%200-1-4%200-4%200-2-1l2-2c0-2-7-7-9-7-4%200-8%202-8%203%201%201-2%202-4%201l-2%201c1%201%201%201%200%200l-4%201v2c-2%201-4%200-3-1l-1-1c-1%200-1-3%201-4l-1-1%2010-2c5%200%206%200%209-3l2-3h-6c-5%200-16-1-20-3l-3%201m-50%2020l-3%201-14%202%201%208c1%208%201%208-4%209l-5%201h9c0%202-2%203-9%204l-4%201v-9h-2c-2%200-3%204%200%207v3c-1%202-1%202%202%204%204%202%2011%203%2020%201l10-2c5-1%2010-6%2010-9l2-2%202-3c0-3%200-3-3-2l-5%201-3%201-2-9%201-4c2%200%204-2%203-3l-2%201h-2v-1l2-1c-1-1-3-1-4%201m78%200l-5%202-3%202-1%201v6c0%201%201%202%203%202l4%201%206%201h4v-2l2%201c1%202%203%201%202-1l2-1c3%201%202-1-1-2s-7-5-7-8c-1-3-3-3-6-2m-116%204l-1%202-1-2c0-2%200-2-3%200-2%201-2%202-1%208l2%2010c2%203%202%204%201%204-2%200-6%208-6%2011%200%201%209%205%2010%204v-4c0-4%202-6%203-5%201%200%201-1-2-9-1-5-2-7-1-14v-8l-1%203m133%209c-2%203-1%207%202%207l1%202c0%204%203%204%207%202%205-4%205-4-1-8s-7-5-9-3'%20fill='%23d3d3d3'%20fill-rule='evenodd'/%3e%3c/svg%3e","aspectRatio":1.4998480704952901,"src":"/static/23ca6ffca6f93abfcf92b3f2eb5000fc/bc3a8/mathew-schwartz-vZFJfIsEa0E-unsplash.jpg","srcSet":"/static/23ca6ffca6f93abfcf92b3f2eb5000fc/d278e/mathew-schwartz-vZFJfIsEa0E-unsplash.jpg 200w,\n/static/23ca6ffca6f93abfcf92b3f2eb5000fc/8539d/mathew-schwartz-vZFJfIsEa0E-unsplash.jpg 400w,\n/static/23ca6ffca6f93abfcf92b3f2eb5000fc/bc3a8/mathew-schwartz-vZFJfIsEa0E-unsplash.jpg 800w,\n/static/23ca6ffca6f93abfcf92b3f2eb5000fc/81ef8/mathew-schwartz-vZFJfIsEa0E-unsplash.jpg 1200w,\n/static/23ca6ffca6f93abfcf92b3f2eb5000fc/989b1/mathew-schwartz-vZFJfIsEa0E-unsplash.jpg 1600w,\n/static/23ca6ffca6f93abfcf92b3f2eb5000fc/9f718/mathew-schwartz-vZFJfIsEa0E-unsplash.jpg 4936w","srcWebp":"/static/23ca6ffca6f93abfcf92b3f2eb5000fc/c6096/mathew-schwartz-vZFJfIsEa0E-unsplash.webp","srcSetWebp":"/static/23ca6ffca6f93abfcf92b3f2eb5000fc/1932c/mathew-schwartz-vZFJfIsEa0E-unsplash.webp 200w,\n/static/23ca6ffca6f93abfcf92b3f2eb5000fc/f4957/mathew-schwartz-vZFJfIsEa0E-unsplash.webp 400w,\n/static/23ca6ffca6f93abfcf92b3f2eb5000fc/c6096/mathew-schwartz-vZFJfIsEa0E-unsplash.webp 800w,\n/static/23ca6ffca6f93abfcf92b3f2eb5000fc/b6424/mathew-schwartz-vZFJfIsEa0E-unsplash.webp 1200w,\n/static/23ca6ffca6f93abfcf92b3f2eb5000fc/7a72d/mathew-schwartz-vZFJfIsEa0E-unsplash.webp 1600w,\n/static/23ca6ffca6f93abfcf92b3f2eb5000fc/1c93c/mathew-schwartz-vZFJfIsEa0E-unsplash.webp 4936w","sizes":"(max-width: 800px) 100vw, 800px","originalImg":"/static/23ca6ffca6f93abfcf92b3f2eb5000fc/9f718/mathew-schwartz-vZFJfIsEa0E-unsplash.jpg","originalName":"mathew-schwartz-vZFJfIsEa0E-unsplash.jpg","presentationWidth":800,"presentationHeight":533}}},"url":"/headless-wordpress-explained-and-why-you-need-it/","categories":["WordPress"],"tags":["Headless WordPress","JAMstack","PHP","JavaScript","React","Gatsby","Performance"],"hide_featured_image":null,"mentorship_og_image":null,"custom_excerpt":null}}},"pageContext":{"slug":"/headless-wordpress-explained-and-why-you-need-it/","previous":{"fields":{"slug":"/10-years-remote/"},"frontmatter":{"title":"10 Years Remote"}},"next":{"fields":{"slug":"/find-a-mentor-to-get-ahead/"},"frontmatter":{"title":"Find A Mentor To Get Ahead"}}}},"staticQueryHashes":["1331100284","1975953531","3493025416"]}