WordPress versus the JAMstack

BUsiness | Technology
Mandy Trilck

Mandy Trilck

WordPress is the reigning champ of content management, currently used to power approximately 35% of the internet. First released in 2004, it has shifted from purely a blogging platform to a multi-purpose website creator that is supported by a huge ecosystem of themes and plugins. Since it’s possible to get a WordPress site up and running inexpensively and with no coding knowledge, it has become the defacto choice for many website owners.

But web technologies have changed a lot over the years and the technology stack that WordPress uses is no longer as trendy as it once was. Frontend Javascript frameworks like React have led to a new way of constructing websites, one that many developers find to be more satisfying. As a result, developers have been exploring alternatives to WordPress and its PHP-based templates.

The JAMstack alternative

JAMstack (Javascript, APIs and markup) is a website technology stack that has been growing in popularity. Javascript is used to power the frontend, APIs connect the frontend to needed services (e.g. content databases and payment gateways) and pages are served as static files.

The critical difference between JAMstack and more traditional website technologies (like WordPress’ LAMP stack) is that a JAMstack site doesn’t rely on a server. Instead of being tied to a database and building pages based on server requests, a JAMstack site is pre-built and serverless. Static files are generated and then sent out over a CDN (content distribution network). Server-like functionalities are handled by third-party services, connected via APIs.

To make creating a JAMstack site easier, static website generators have emerged as well. With a SSG like Gatsby or Hugo, a developer can quickly spin up a basic website.

Decoupled content management

JAMstack sites have several possibilities for managing content, including “headless” content management systems (CMS). A headless CMS allows users to easily add content to a site from an admin panel. Depending on the type of CMS, this content is either sent to the source code’s repository, or stored in a self-hosted server or cloud platform service. You can read more here about headless CMS choices.

A static site can fetch data stored in a server via an API. How the data is displayed is managed entirely by the frontend.

The difference between JAMstack and WordPress

Let’s look at the how the structure of a Gatsby site compares to WordPress:

Gastby vs WordPress

The benefits of a JAMstack site over WordPress

Besides being the “new shiny thing” in web development, there are other reasons why JAMstack has become an increasingly popular approach. It solves many pain points for website owners and developers alike, such as being faster, cheaper, easier to scale and more secure.

Speed

JAMstack sites load fast. Also, routing libraries can be harnassed that make internal links appear instantaneously. It’s an incredibly satisfying user experience, and a very desirable one at a time when speed is so prized by search engines.

JAMstack sites are so fast because of the way pages are built and deployed. Pages aren’t generated via requests to a server, but are pre-built and served over a CDN. Traditional server-built sites can utilize CDNs too, but to store cached static content, like images and stylesheets. It’s much faster when the entire site can be served via CDN.

Cost

Hosting static files is cheap, and is often free for smaller sites.

Scaling is much easier too. With a traditional site, spikes in traffic can be problematic because they can slow down the server, or even cause it to crash. With a CDN, it’s easy to scale up to meet user demand.

Better developer experience

Developers can pick the Javascript libraries and frameworks (e.g. React and Vue)  that they want to work with and leverage modern tools like Babel and Webpack. Also, there are a number of static site generators (e.g. Gatsby and Hugo) that make setting up a great development environment incredibly easy.

It’s also convenient that the site’s code is stored in a repository like Git instead of a server. When changes are made, the repository keeps track of the changes, and makes it possible to revert to previous versions. If other developers need to collaborate, they can pull the code down from Git onto their local environment to make changes. This means that no complex installs are necessary.

Security

Since JAMstack sites send out pre-built pages and don’t have dynamic interactions with a server, they are far less prone to attacks. You don’t have to worry about server or database vulnerabilities.

WordPress sites require frequent updates to stay ahead of security vulnerabilities. Without attention to this, a site is open to malicious attacks.

The limitations of a JAMstack site

In spite of all this coolness, in many cases JAMstack will not be the right choice for a project.

Reliance on a developer

You have to know your way around Javascript in order to get a JAMstack site running. Even if you’re handy with JS, a JAMstack site will be far more time consuming to setup than a WordPress site.

With WordPress, it’s not necessary to have technical knowledge to make a website, and to make it quickly. With the right theme and plugins, anyone can have a professional, functioning website in short amount of time.

If you do opt to hire a developer to setup a JAMstack site, any changes you will need in the future will require a developer. With WordPress, however, many style changes can be made straight from the dashboard through the theme editor. For additional customization beyond what a theme offers, it’s usually possible to find a plugin that can fix a problem or add an additional functionality. If not, the quantity of documentation that exists in the WordPress community makes it possible for non-technical people to find solutions.

Still more static than dynamic

JAMstack isn’t good for highly dynamic sites. This includes sites that need constant updates, like a large news site, or ones that have lots of user interaction. The JAMstack ecosystem is improving its capabilities all the time, but it’s not quite there yet.

One of the reasons for this is build time. When a change is made to the code or content of a site, a rebuild will be triggered. If a site is large it could take around 15 minutes to build, which can be annoying when making small updates or corrections. Static hosting services typically charge based on build minutes, so making frequent updates will quickly use up minutes unless you have a generous plan.

Fortunately, there are ways to cache images and pages to help speed up build time, so it’s not necessarily a problem if you have a lot of content, only if it’s a lot of content that is updated frequently.

Optimized WordPress sites can be very fast

A multitude of guides exist that give excellent ways of speeding up WordPress sites. If the rules are heeded–use a CDN, a lightweight theme, optimized images, etc.– a WordPress site can be very fast. 

WordPress gets a bad reputation for speed due to bad practices by some of its users. Since there is a low barrier to entry, not everyone with a WordPress site has knowledge or experience with site optimization. They sometimes unwittingly build sites that are burdened with unnecessary plugins and large image files.

Conclusion

JAMstack sites are a fun part of the Javascript ecosystem. If you have technical members on your team who are handy with Javascript, or the budget to hire them, it’s one way to have a blazing fast, unique site for your brand.

WordPress is still probably the best choice in many cases, however. This is especially true if your team is mostly non-technical and you don’t have the budget for a custom site with ongoing development fees. The good thing is that, with attention to optimization and updates, it’s possible to have a fast and secure website with WordPress.

Know your types of headless CMS

The business risks of overlooking software documentation

Zero to MVP the right way

Share This