Home Forums Add-ons Flexible Content Field Contract all flexible content fields by default


Contract all flexible content fields by default

  • I am looking to have all flexible content fields contracted (hidden) by default when visiting a page. Any help at all greatly appreciated

  • This reply has been marked as private.
  • Hi James,
    I’m also interested to know how to hide flexible content fields.

  • Hi @bonjour

    I believe you can add a script to click the collapse button automatically when the page is loaded like this:

    add_action('acf/input/admin_head', 'my_acf_admin_head');
    function my_acf_admin_head() {
        <script type="text/javascript">
        (function($) {
                $('.acf-field-flexible-content a.-collapse').click();
        <style type="text/css">

    I hope this helps πŸ™‚

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.