How to run WordPress Serverless

Rahul Biswas
2 min readDec 14, 2020
How to run WordPress Serverless — WPSteam

My other blog is completely serverless and in this post I will go through the steps, pros and cons to hosting and setting up a serverless blog yourself at a cost of $0 per month.

It runs completely on AWS, the static site is stored on S3 and then served with HTTPS through CloudFront. The WP Instance is a small EC2 instance that I manually start, write my blogs and then shutdown to save cost. When I want to publish a new blog, I use a WP plugin to crawl the site and create static files that is then downloaded as a ZIP file. On my local machine I run a GULP script that does some pre-deployment work and then uploads the files to S3 and invalidates the CloudFront CDN edge nodes.

Beyond WordPress

The words serverless and wordpress, are not often used in the same sentence, but recently there have been great developments to create static serverless websites and still maintaining all the wordpress goodness. A great example is Shifter, they spin up a WordPress container that you can then use to write your blogs, pages and do all the other WordPress related magic. Then with a few clicks it crawls and creates a static website with all your posts, pages, etc and then deploys it to a CDN. Then there is also Gatsby, it uses the WP API to pull data out and then uses that to great your static site (not entirely sure how).

Then there is WP2Static, this is a plugin for WP and it essentially crawls your WP site and then generates all the static pages and hierarchy for you. It can then be downloaded as a zip file, deployed to S3 + Cloudfront, Netlify, Github pages and many more options.

That sounds great! So now you don’t have to worry about any security issues, updates to outdated plugins and scaling issues or capacity provisioning . Not everything is greener on the other side though, certain plugins that require your WP host to be online will not work. The default WP comments is an example, it posts back to your WP instance. This means that the default plugins for forms, comments, etc will not work. Fear not, third party to the rescue, for forms you can use Gravity Forms or even a plain old Google Form (saves a buck and just as effective). For comments consider Disqus, word is that their not too big on privacy and some complaints about adds on the free basic plan (have not experienced any of this first hand). So a great alternative among the thousands of commenting plugins out there, is CommentBox which just stood out for me…

READ THE FULL STORY BY CLICKING HERE

--

--

Rahul Biswas
0 Followers

I’m a Passionate Programmer, Web Developer and Blogger. WPSteam (https://wpsteam.in) is my website.