• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

We’re currently booked about six weeks out and accepting new work.

Questions? Call 254.340.0086 or send an email to jon@elod.in.

Elodin Design

WordPress Design & Development

  • About
    • About Jon
    • Why ‘Elodin Design’
  • Websites
  • Services
  • Process
  • Blog
  • Repos
  • Contact

Gutenberg is breaking ACF blocks: here’s how to fix it

January 25, 2019 by Jon Schroeder Leave a Comment

Based on a number of github threads like this one, I’m not the only one experiencing this issue: WordPress is adding <p> tags willy-nilly throughout code that shouldn’t have it.

What’s happening is this: the wpautop filter is firing double, essentially, if you ever use any of the following when rendering an ACF block for Gutenberg. That means it’s wrapping every line with <p> tags in every block on the page, if any of the blocks use any of the following to render:

  • Core WordPress function the_content()
  • Core WordPress function the_excerpt()
  • Core WordPress filter ‘the_content’
  • ACF core function the_field()

To make things worse, even if you’re getting around all of these, but there are any shortcodes inside your ACF content area (for example, outputting which do use any of the above, then the whole page will still break.

Here’s what you can do to put a bandaid on this:

I think it’s possible there’s a better solution out there, something along the lines of Elliot Conden’s example here, but I don’t want to add complexity to troubleshooting this later on the assumption that Gutenberg will eventually fix this.

There’s been a Trac ticket awaiting review on this topic for the last 8 weeks, so hopefully they get to that soon.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

About the blog

I’ve always been exceptionally bad at actually sitting down and writing blog entries, so do me a favor – please feel free to comment or drop me a line if you have something you’d like me to write about (or just to say hello).

Browse by category

  • Advanced Custom Fields
  • Gutenberg
  • Perspective
  • Tutorials & how-to guides
  • Updates

Centered and full-justified text on the internet

How to add contextual styling in the Gutenberg editor

User interface is really important

How to connect Gravity Forms with Salesforce web-to-lead using Gravity Forms’ Webhooks addon

Reviewing SpinupWP and why I closed my account

Ready to get started?

There’s no pressure. If you’re interested in building a site, please feel free to reach out – and I’ll talk through your project with you and give you some pointers even if we don’t end up working together.

Reach out

Elodin Design, Inc. (formerly Red Blue Concepts)
Website design & development · Custom WordPress theme and plugin development
3305 Fox Hollow Circle, Waco, TX 76708 · (254) 340-0086
Copyright © 2021 · All rights reserved.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Non-necessary

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.