Support

Account

Home Forums ACF PRO How to disable field editing in specific environment (live/staging)?

Solved

How to disable field editing in specific environment (live/staging)?

  • Hi,

    Is there a way to disable editing of field groups and fields on a specific environment (like live and staging)? I’m using ACF:s local-JSON feature and I want to keep my local development as the “source of truth” and not have to worry that a user is fiddling with the fields on the live site. At the same time, I have to be able to sync the fields on the live site when I push changes to it – so at least I have to have access to the sync button at least.

    Any way to accomplish what I’m after?

  • Hi,

    If i’m right, you just want to avoid user with back-end access to make change on ACF. I don’t know if you can disabled field editing on specific environnement (live and staging) but you can simply change the capability needed to access ACF editing with the ‘acf/settings/capability’ filter.

    I made the same for my website :

    1) Create a specific capability named ‘edit_acf’
    2) Set this specific capability as access rule for ACF with ‘acf/settings/capability’ filter
    3) Add the specific capability only to role/user you want

    This will not make your “staging ACF json” as “source of truth” but you’ll be sure that’s user can make change.

    Hope it’s solve your issue

  • Actually, you do not need to sync the field groups if you are using local json files. The field groups simply need to be in the right folder. You can delete the fields in the ACF admin and upload the json files. No one will be able to modify these fields on the site unless they sync them. Then you disable the ACF admin completely and they can’t sync them. The only play you edit them is on the dev site and then upload them when you’re ready.

  • Aha, so the fields will show up when editing the content on the live site anyway – without anyone syncing the fields? If so, that’s just great for my use case!

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

The topic ‘How to disable field editing in specific environment (live/staging)?’ is closed to new replies.