What are custom WordPress blocks?

Custom blocks are designed to make content management easier.

Categorised: Opinion
Posted by David Foreman. Posted: October 21, 2024 | Updated: December 18, 2024

As WordPress races to become the leader in full site editing, many businesses turn to custom content blocks to gain better control over their content management.

If you have used Gutenberg, you will already be familiar with the blocks available on the site.

These blocks are designed to accommodate generic content requirements and often require some effort to look correct.

They also output a serious amount of code on the front end.

So, what is a custom WordPress block?

In our case, custom blocks use Advanced Custom Fields to build blocks containing all the fields you need for your content.

Rather than bending your content into a combination of generic blocks, we design and build you a block specifically for that content.

The advantages of this are:

  • Speed of publishing: pushing new content live is quicker and easier because your blocks are built for what you need them for.
  • Less code: custom blocks are lightweight and only load their code, CSS and JS when used on the page,
  • Easier development: as you get what you need, the development costs are minimal if you change the block later.
  • Accessibility: ACF for custom blocks means the fieldsets are accessible to clients.

The anatomy of a custom block.

ACF has many fieldsets that can be added to custom blocks. These include standard fields like a WYSIWYG editor, text fields, text areas, links, images, maps, and so on. A full list can be found here.

A field set is created in ACF and mapped to the custom block code.

In our theme, all custom blocks live in a ‘blocks’ directory; each field set is associated with one block in that library.

The block code, CSS, and any JS also live in the block directory folder, one directory for each block, so everything is very neat, organized, and lean.

An example of an ACF custom WordPress blocks

This is the CTA block for this site with all the fields that the content requires.

As each block is purpose-built, using it is incredibly simple, even for non-technical users, so publishing and editing content becomes easier.

Pre-styled custom blocks.

Another advantage of a custom ACF block is that all the styling is centralised within the block’s own CSS stylesheet.

This means that all the content you add to the block outputs correctly on the front end to the approved design.

If you need to change the styling, it’s done in the CSS and changes every block on the site, so website refreshes and changes are easily done without having to start from scratch, and your marketing team can be confident that everything live is on-brand.

Why use ACF for the blocks instead of coding it into the theme?

In a word, accessibility.

ACF is widely considered one of the best plugins for WordPress and is used by millions of websites.

It’s not going anywhere; it’s being continually developed, and most importantly, it means that when used on your site, it’s accessible to you or anyone who does development work on your site today or in the future,

Coding all this into the theme would be more complex and take longer. The result would be out-of-date in six months, taking significant time for a new developer to understand, and resulting in higher project fees.

The only reason to hand-code all the blocks into the theme would be to make it larger, more complex, and harder for other developers to understand —all common tactics of agencies that don’t work within WordPress’s open-source ethos.

Dave Foreman WordPress SEO Expert

David Foreman
Managing Director

There is virtually no limit to what you can do with custom WordPress blocks.

From simply making your content easier to manage to more complex functions such as third-party API integrations, custom blocks give you a completely flexible site.

Get A Better Website

Custom WordPress blocks do not cost more to develop than off-the-shelf options.

Developers find it easier to build sites using custom blocks than to spend hours battling with the UI of a generic block set.

Remember, as generic block sets try to be everything to everyone, their configuration is time-consuming, buggy, and painful.

As we develop our own theme, we have a set of standard blocks that our theme ships with; these cover lots of common content requirements and are styled to match your branding. This means you also save your budget by not having to pay for development work on these blocks, as they are already done.

Why would you want to be the same as everyone else?

Every business website is different, mainly because every business has different things to say, different content to share and different branding.

Trying to bend your company’s content into the same generic set of blocks that 1000s of other sites use suggests that you will end up with a website similar to the other 1000s of sites: you don’t want that.

Custom content blocks also save you money in the long run.

As well as being quicker to set up in the first place, ACF custom blocks are also quicker to develop as your site grows.

If you have a new type of content for your site, setting up a new block for it is simple; do you want to clone an existing block with some slight modification? You are looking at less than an hours work.

The flexibility of custom blocks means that whatever your site needs as it grows can be built quickly and efficiently – if you need to change existing blocks, this can also be done globally, saving hours of development work.

Custom blocks also work with WordPress patterns.

WordPress patterns are a superb addition to the WP editor.

They allow you to build content from a collection of blocks and then insert this global content anywhere on your site.

Custom blocks work with patterns, which means you can build complex data or pricing tables, save them as patterns, and then insert them anywhere on your site.

Need to change data or prices? Just edit the pattern and everything across your site updates in real-time.

In addition, you can release a global pattern and edit it as a unique item – this can be a real-time saver when building complex layouts.

Custom blocks also work seamlessly with more complex integrations.

Custom WP queries, REST and third-party API calls, database lookups, and a wide range of other more complex work can be accommodated right within your custom ACF blocks. This means you are not limited to the operations of a generic block; you can get your site to do exactly what you need.

Get a site that does what you need it to.

ACF custom blocks, built properly and accessibly, will give you a website that will serve you for years. With their flexibility and seemingly endless scope for development, you can get a website that is easier to manage, faster than your competitors and future-proof.

About this article.

We always try and publish useful and helpful content on our website. ‘What are custom WordPress blocks’ has been written by David Foreman and researched (links below).

Our experience

We have been working with ACF fields since the plugin came onto the market over a decade ago. In the early days, people used ACF’s flexible content fields to improve the page editing experience. Still, with the introduction of Gutenberg and generic blocks, ACF has become one of the most essential WP plugins.

It’s such a great plugin that Delicious Brains acquired it in 2021 when Elliot handed over the reins to this larger, respected plugin developer.

More recently, Delicious Brains was further acquired by WP Engine, bringing the plugin into the ownership of one of the world’s premier WP hosting companies, where it continues to be developed and improved.

Our expertise

We’ve been working with ACF Pro for over a decade and have built the ACF functionality directly into our theme to help our clients manage their content without developer intervention.

We have an ACF Pro developer licence, which we use on all our client’s sites for free, saving our retained clients the licence cost.

Our theme uses a developer-friendly method of integrating ACF blocks (less than 20 lines of code). New blocks are easily registered simply by adding them to the /blocks/ directory within our theme and creating an ACF field set that is then attached to the block.

For the benefit of our clients, we also use the Theme Code Pro plugin, which generates the PHP code for the block – it’s as easy and accessible as we can make it.

Why are we an authority on this topic?

We know what we are doing, as we have built an entire theme around ACf Pro and created hundreds of sites based on it. The ACF Pro plugin is incredibly easy to use, and our theme is optimized to be quick to develop.

At Toast, we also write our plugins; several are in the plugin repository, which are used on thousands of websites.

Why you can trust us

As we provide support for 100s of WordPress sites, we’ve come across no end to what we consider unethical behaviour from so-called WordPress experts.

We use all the bad things we find to ensure we do exactly the opposite. All our themes are accessible and built in the open-source ethos; when our clients pay their final invoice, their website is theirs to own and do as they like.

David Foreman

David Foreman

Dave is the MD at Toast and has been building bespoke WordPress sites for over 15 years. He currently gets involved in the scoping and planning of new sites together with content and SEO strategy to get sites ranking.

Menu