Getting your Craft CMS website ready for production

Thomas Schoffelen
Sep 12 · 4 min read

I’ve never really liked working with CMSes (and I’ve tried quite a few!), since it often feels like you’re spending more time working around limitations of the CMS and cutting corners to make content editable for your customers, instead of focussing on building quality web experiences.

Since I stumbled across Craft CMS a few years back, however, I haven’t really looked back. The blank-slate approach of Craft — no default templates, no boilerplate code — makes it easier than ever to build an experience exactly in the way you had it in mind. By now, our agency Infowijs has built more than a dozen Craft sites, and every time we build a site we learn something new that we love about Craft.

Here’s our most important steps in getting those beautiful websites ready for launch:

Image transforms everywhere

After our initial build of a site has been approved by the customer, one of the first things we do is search for all instances of .url in our Twig templates, and create appropriate image transforms that scale images to be the perfect size and quality for every part of the page.

That’s as easy as:

  1. Creating a new transform, choose a crop mode, enter width and height, and choose an image quality and format.
  2. In your template code, simply replace your {{ asset.url }} with
    {{ asset.getUrl('transformName') }}. Easy as that!
The UI for creating a new image transform in Craft CMS.

Adding SEO fields

The next thing we do is install the great SEO plugin by Ether Creative. It’s like Yoast for Wordpress, but built to fit within the simplistic style of the Craft admin panel. For each entry type that has its own pages (blog posts, about pages) we add the SEO field as a separate tab, so the customer always knows where to go to add a custom Facebook or Twitter image or edit the meta description of the post.

How we organise blog entry types.

If a customer has a blog on which they plan to post long-form articles, we also add a ‘Custom styles’ tab, where we use the CodeMirror field type plugin to allow the user to add custom CSS per post, to make sure that every post can have it’s own look and feel.

Making it (even) faster

Out of the box Craft’s performance is amazing, but for that little bit of extra speed, we always recommend Blitz, which generates static HTML versions of your pages to be served either directly from disk or via a CDN of your choice to make the site even faster, while reducing the load on PHP-FPM or mod_php.

The added advantage of this is that the site will even be available when you’re performing maintenance or updates, so that your users won’t ever notice any downtime while you deploy changes.

Disabling settings changes in production

With the new project.yaml config files, any changes in the structure of your sections and fields don’t require you to manually update your production database or write migrations. Simply deploy the new version of the site, and Craft will take care of syncing up the database to comply with your project’s project.yaml file.

To take full advantage of that, it’s important to disable structural changes on production, so that you’re always pushing upstream. This is the config/general.php file that I usually use:

<?phpreturn [
// Global settings
'*' => [
'omitScriptNameInUrls' => true,
'cpTrigger' => 'admin',
'securityKey' => getenv('SECURITY_KEY'),
'useProjectConfigFile' => true,
'sendPoweredByHeader' => false,
'defaultImageQuality' => 77
// Dev environment settings
'dev' => [
'devMode' => true,
// Production environment settings
'production' => [
// Prevent administrative changes in production
'allowAdminChanges' => false,
'allowUpdates' => false


Learned something, or have something to teach me? Hit thumbs up and send me a message via my contact details on!

Thomas Schoffelen

Written by

Entrepreneur tech kid, co-founder of NearSt, Londoner, open source enthusiast and aspiring spare time literature geek.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade