Skip to main content

Use Wordpress as a headless CMS

Wordpress is the most popular CMS in the world, but is difficult to use in a "headless" form, i.e. with a custom frontend.

In this tutorial, we show how to use Fresh, a modern web framework built on Deno, to create a frontend for headless Wordpress.

Step 1: Clone the Fresh Wordpress theme

Fresh offers two ready-to-go themes, one for a blog and one for shopfront.

Blog

git clone https://github.com/denoland/fresh-wordpress-themes.git
cd fresh-wordpress-themes/blog
deno task docker

Shop

git clone https://github.com/denoland/fresh-wordpress-themes.git
cd fresh-wordpress-themes/corporate
deno task docker

Note that Blog and Shop themes use different setups for WordPress server. Make sure you run deno task docker command in the right directory.

Step 2: Open another terminal in the same directory and run:

deno task start

Step 3: Visit http://localhost:8000/

You can manage the contents of the site via the WordPress dashboard at http://localhost/wp-admin (username: user, password: password).

WordPress hosting options

There are a lot of options for hosting WordPress on the internet. Many cloud providers have special guides and templates dedicated to WordPress. There are also dedicated hosting services for WordPress, such as Bluehost, DreamHost, SiteGround, etc. You can choose which is the best fit for your needs from these options.

There are also many resources on the internet about how to scale your WordPress instances.