Back to news

<h1> Solving the ACF Flexible Content Field Dilemma </h1>

At Colluco, it’s no secret that we harness the power of our custom WordPress theme to craft the websites we deliver to our clients. Like many in the web development arena, we enhance WordPress’s innate flexibility through the Advanced Custom Fields (ACF) plugin. Our custom WordPress theme has been the backbone of our business since its inception. Despite undergoing numerous refinements and iterations, its essence lies in utilising ACF’s flexible content field. This powerful feature enables us to construct custom-designed website blocks, while ensuring all content remains fully editable and adaptable to our clients’ needs.

 

<h2> The Dilemma </h2>

In September 2022, Advanced Custom Fields (ACF) underwent a significant upgrade that revitalised the entire plugin, offering improvements across the board. Initially, this update appeared to be a windfall, streamlining our workflow, updating the tired UI, and promising even more dynamic capabilities for our client projects. However, the shine of the new ACF version quickly tarnished when we updated a few client sites and discovered a critical issue: our flexible content page layout, a cornerstone of our custom theme, had become virtually unusable.

Our commitment to providing clients with extensive customisation options through our content blocks had, inadvertently, become our Achilles’ heel. The comprehensive nature of our flexible content fields, designed to offer enhanced flexibility, now meant they were too cumbersome to load efficiently. WordPress pages featuring more than a handful of our modules would crash, and attempts to edit within the flexible content fields were met with endless loading screens. The realisation hit us hard—every site we had developed in the past two years was built on this system, and we were now facing a ticking time bomb with the inevitable need to update all these sites to ACF 6 looming over us. The race for a solution was on, and the clock was ticking.

 

<h2> The Solution </h2>

Addressing the challenge we faced required innovative thinking, particularly because our issue was unique to our approach. The use of flexible content blocks is a standard practice in web development, but the depth of customisation and flexibility we provide is unparalleled, leaving us without a straightforward solution. Our breakthrough came when we began experimenting with the ACF clone field, a feature that allowed us to emulate the original flexible content field group but with significantly fewer fields.

Traditionally, our flexible content encompassed every possible field for each content block available on the site. By implementing the clone field, we were able to segregate each content block into its own field group, subsequently integrating all necessary fields through a single clone field. This strategy immediately resolved our loading issues, marking a pivotal moment in our quest for a solution.

However, this innovation introduced a new concern: the manual labor involved in the process. Considering the number of client sites relying on our system (each requiring this update as a courtesy, not a chargeable service, since an update should not render a site unusable), we were daunted by the potential time investment.

 

<h2> The Implementation </h2>

Confronted with the daunting prospect of manual labour required for the update across all our client sites, we innovated a solution to overcome the challenge of time investment. Our team developed a specialised script capable of automating the conversion process. The script processed an exported JSON file, of our original flexible content field group and transformed it into a new JSON file. This new file ingeniously split the comprehensive flexible content into separate field groups, each to be reincorporated as clone fields within the flexible content structure.

Our ACF Field Group Converter

This strategic automation reduced what would have been over an hour of meticulous work per site to a mere five minutes, streamlining the process to a simple export and import within WordPress. This dramatic reduction in time and effort not only allowed us to swiftly address the loading issue across numerous sites but also exemplified our commitment to leveraging technology for efficiency and client satisfaction.

Our journey through identifying and resolving a critical challenge with ACF’s flexible content fields was probably one of the biggest challenges we have faced since our inception, but it underscores our dedication to innovation and client service. By turning a potential crisis into an opportunity for development improvement, we reinforced the robustness of our custom WordPress theme and solidified our position as innovative web solution providers. This experience has further strengthened our resolve to always seek out smarter, more efficient ways to meet our clients’ needs, ensuring that we remain at the forefront of the digital landscape.

Thank you for engaging with our story. For more details about our journey or to explore potential collaborations, please get in touch via our website, email us at [email protected], or call us at +44 (0)1218 272750.