From WordPress to JAMstack: How to make your website 10x faster
Tags: javascript, react, gatsby, jamstack
Published: 2019-02-15 19:02:00

---
title: From WordPress to JAMstack: How to make your website 10x faster
published: true
description: If you have an existing WordPress website, you may be familiar with slow page load. This can be due to server-side processes that occur prior to even getting to the HTML. If you are looking to make the switch to a better experience for your users, it might be time to switch to a JAMstack website. And making the switch may be easier than you think.
tags: javascript,react,gatsby,jamstack
---
![WordPress to JAMstack](https://cosmic-s3.imgix.net/81d20690-2fd7-11e9-b5b0-537fab8cf4f1-wordpress-to-jamstack.jpg?w=1000)

Performance matters. If you are familiar with [JAMstack](https://jamstack.org/), the movement encourages avoiding server-side rendering completely in favor of pre-build, purely static HTML pages. By serving only JavaScript, APIs, and Markdown (JAM) over a CDN, a website's performance is dramatically increased, making for a much better user experience.

If you have an existing WordPress website, you may be familiar with slow page load. This can be due to server-side processes that occur prior to even getting to the HTML. If you are looking to make the switch to a better experience for your users, it might be time to switch to a JAMstack website. And making the switch may be easier than you think.

In this tutorial we're going to import existing WordPress content into a JAMstack website, deploy to [Netlify](https://www.netlify.com/), then perform Lighthouse tests on the two versions to determine if there are any significant performance gains. (Hint: there are 😁)

### TL;DR
1. Install the [Gatsby Blog](https://cosmicjs.com/apps/gatsby-blog), a ready-made JAMstack website powered by Gatsby and the [Cosmic JS Headless CMS](https://cosmicjs.com/).
2. Import existing WordPress posts into Cosmic JS using the [WordPress Importer](https://cosmicjs.com/extensions/wordpress-importer).
3. Deploy the Cosmic-powered website to [Netlify](https://www.netlify.com/).


### Getting Started
First we'll need to install the [Gatsby Blog available in the Cosmic JS Apps Marketplace](https://cosmicjs.com/apps/gatsby-blog).
![Gatsby Blog](https://s3-us-west-2.amazonaws.com/cosmicjs/de4febf0-2fd5-11e9-b5b0-537fab8cf4f1-gatsby-blog.png)

After we install the app to a new Bucket, we'll need to install the [WordPress Importer Extension](https://cosmicjs.com/extensions/wordpress-importer). This can be found by navigating to Your Bucket > Settings > WordPress !Importer.
![WordPress Post Importer](https://s3-us-west-2.amazonaws.com/cosmicjs/e9b0d970-2fdd-11e9-bcc2-2577878f6093-Screen-Shot-2019-02-13-at-2.22.37-PM.png)

Follow the directions in the Extension to import your WordPress posts.
![Import WordPress Posts](https://s3-us-west-2.amazonaws.com/cosmicjs/54fc79d0-2fd6-11e9-bd49-3dc9dc02a911-import-from-wordpress.gif)

After importing your posts, you'll see that our Posts Object Type now includes the imported WordPress posts, that was easy! Now let's deploy this sucker.

### Deploy 🚀
There are a few options to deploying our website located in Bucket > Settings > Deployment. We'll go ahead and deploy to Netlify since they've perfected the art of JAMstack hosting, plus [they invented the JAMstack term to help us wrap our heads around the concept](https://www.netlify.com/blog/2019/01/17/the-importance-of-developer-experience-with-github-founder-tom-preston-werner/).
![Deploy to Netlify](https://s3-us-west-2.amazonaws.com/cosmicjs/9837f830-2fe2-11e9-bcc2-2577878f6093-netlify.jpg)

After we add our [Gatsby Blog GitHub repo](https://github.com/cosmicjs/gatsby-blog-cosmicjs) to Netlify, we'll need to set up our environment variables in Netlify to connect to Cosmic JS prior to deployment. Go to Sites Settings > Build and Deploy to add the environment variable `COSMIC_BUCKET` with the value set to your Bucket slug. If you set a read key in your Bucket settings, add that here also as `COSMIC_READ_KEY`.
![Add Ketys](https://s3-us-west-2.amazonaws.com/cosmicjs/98cfc0d0-2fe1-11e9-b5b0-537fab8cf4f1-Screen-Shot-2019-02-13-at-2.49.04-PM.png)

Now go to the Deploys tab and Trigger deploy 🚀🚀🚀
![Trigger Deploy](https://s3-us-west-2.amazonaws.com/cosmicjs/26ecd4b0-2ffc-11e9-8cfa-5399f8add39f-Screen-Shot-2019-02-13-at-5.58.51-PM.png)

### Compare 🧐
Now that our new JAMstack website is deployed, let's compare performance between the old WordPress website and our new Cosmic-powered JAMstack site. Open the Chrome console and run the Lighthouse tests on each website. Check out the results below (though the design is different, the post count on the page is roughly the same).


WordPress TechCrunch
[https://techcrunch.com](https://techcrunch.com)
![WordPress Lighthouse test](https://s3-us-west-2.amazonaws.com/cosmicjs/0ff24300-2fd7-11e9-bcc2-2577878f6093-1550093632657.jpg)

Gatsby, Cosmic, JAMstack TechCrunch
[https://wordpress-to-cosmic.netlify.com](https://wordpress-to-cosmic.netlify.com)
![Gatsby, Cosmic, JAMstack Lighthouse test](https://s3-us-west-2.amazonaws.com/cosmicjs/13fe5560-2fd7-11e9-9303-237d75ea4841-1550093640330.jpg)

As you can see after running the Lighthouse tests our Cosmic-powered Gatsby JAMstack website blows the WordPress site away with a massive performance increase. And check out the transitions between pages on the [JAMstack version](https://wordpress-to-cosmic.netlify.com/), it's 🔥

### Conclusion
I hope you enjoyed this tutorial on how we can build a dramatically faster web experience by moving from WordPress to a Cosmic JS-powered JAMstack website. Try it out for yourself and you may be surprised how easy it is to make the switch. Your users will thank you.

Join the conversation around API-driven content management, JAMstack and new web tech [on Slack](https://cosmicjs.com/community) and reach out to [Cosmic JS on Twitter](https://twitter.com/cosmic_js).

This article was originally posted on [the Cosmic JS learning center](https://cosmicjs.com/articles/from-wordpress-to-jamstack-how-to-make-your-website-10x-faster).